[wp-trac] [WordPress Trac] #29810: Prevent HTML Corruption When Shortcodes Are Not Allowed

WordPress Trac noreply at wordpress.org
Wed Oct 1 02:44:14 UTC 2014


#29810: Prevent HTML Corruption When Shortcodes Are Not Allowed
--------------------------+------------------------------
 Reporter:  miqrogroove   |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Formatting    |     Version:  2.6
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by kitchin):

 Are you missing `global` in the three functions at the end of
 miqro-29810.2.patch ?

 And just as a matter of style at line 214
 {{{
 $pos = strpos( $text, '[' );
 if ( false !== $pos ) {
    if ( false !== strpos( $text, ']', $pos ) ) {
      $find_shortcodes = true;
    }
 }
 }}}
 can be one-lined to
 {{{
 $find_shortcodes = is_int( $pos = strpos( $text, '[' ) ) && is_int(
 strpos( $text, ']', $pos ) );
 }}}

 But note the Wordpress codebase does not use the idiom `is_int(strpos())`
 currently. Just a matter of style vs. `false !==`. Has better parentheses!

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29810#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list