[wp-trac] Re: [WordPress Trac] #4275: PHP Exec Widgets repeat in WP 2.2 widget implementation

WordPress Trac wp-trac at lists.automattic.com
Thu May 17 17:18:33 GMT 2007


#4275: PHP Exec Widgets repeat in WP 2.2 widget implementation
---------------------------------+------------------------------------------
 Reporter:  technosailor         |        Owner:  anonymous
     Type:  defect               |       Status:  closed   
 Priority:  high                 |    Milestone:  2.2.1    
Component:  Administration       |      Version:  2.2      
 Severity:  normal               |   Resolution:  fixed    
 Keywords:  widgets needs-patch  |  
---------------------------------+------------------------------------------
Comment (by Otto42):

 Bad use of the trinary. eval() returns a null unless there's a return
 statement in the eval'd code. The eval() itself will cause the output of
 the non-php code.

 Anyway, I really was responded to fools' statement where he seemingly
 disliked the idea of a checkbox. If you want a checkbox, the right way is:

 {{{
 <div class="textwidget">
 <?php
 if ($codechecked) eval('?>' . $text );
 else echo $text;
 ?>
 </div>
 }}}

-- 
Ticket URL: <http://trac.wordpress.org/ticket/4275#comment:20>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list