[wp-trac] [WordPress Trac] #25709: Searches with stopwords can trigger E_WARNING when PCRE is lacking UTF-8 support

WordPress Trac noreply at wordpress.org
Sat Oct 26 14:37:18 UTC 2013


#25709: Searches with stopwords can trigger E_WARNING when PCRE is lacking UTF-8
support
--------------------------+--------------------
 Reporter:  nacin         |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  high          |   Milestone:  3.7.1
Component:  General       |     Version:  3.7
 Severity:  major         |  Resolution:
 Keywords:                |
--------------------------+--------------------

Comment (by tenpura):

 I think the warning is about lacking of Unicode properties support which
 is differrnt from UTF-8 support. Here are some codes might be useful from
 Kohana framework.

 {{{
 <th>PCRE UTF-8</th>
 <?php if ( ! @preg_match('/^.$/u', 'ñ')): $failed = TRUE ?>
         <td class="fail"><a href="http://php.net/pcre">PCRE</a> has not
 been compiled with UTF-8 support.</td>
 <?php elseif ( ! @preg_match('/^\pL$/u', 'ñ')): $failed = TRUE ?>
         <td class="fail"><a href="http://php.net/pcre">PCRE</a> has not
 been compiled with Unicode property support.</td>
 <?php else: ?>
         <td class="pass">Pass</td>
 <?php endif ?>
 }}}


 https://github.com/kohana/kohana/blob/3.3/master/install.php#L99

 One more thing I need to tell is the regex
 {{{
 /^\p{L}$/u
 }}}
 matches to a single Japanese character, because L property includes Lo
 property which actually matches to it. So the regex matches a non Japanese
 (or Chinese) single letter would be like
 {{{
 /^(\p{Ll}|\p{Lu}|\p{Lm}|\p{Lt})$/u
 }}}

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25709#comment:6>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list