in an original code (Drupal core module) previous developer commented out the string:
if (preg_match('/[^\x{80}-\x{F7} a-z0-9@_.\'-]/i', $name)) {
and instead, added:
if (preg_match('/[^\x{80}-\x{F7} a-z0-9@_.\'-]/iu', $name)) {
Can you help me to understand what the difference between these two? What u modifier does? In php docs I found:
u (PCRE8)
This modifier turns on additional functionality of PCRE that is incompatible with Perl. Pattern strings are treated as UTF-8. This modifier is available from PHP 4.1.0 or greater on Unix and from PHP 4.2.3 on win32. UTF-8 validity of the pattern is checked since PHP 4.3.5.
So I guess, previous developer had problems with interpreting special characters or something. I'm a bit puzzled, please advice on this.