Bug #73251 [NEW]: [а-я] range contains not all cyrillic letters, filtar_var() fails for valid str

From: Date: Wed, 05 Oct 2016 11:01:08 +0000
Subject: Bug #73251 [NEW]: [а-я] range contains not all cyrillic letters, filtar_var() fails for valid str
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-204469@lists.php.net to get a copy of this message
From: ikonta at yandex dot ru Operating system: Linux PHP version: 5.6.26 Package: Filter related Bug Type: Bug Bug description:[а-я] range contains not all cyrillic letters, filtar_var() fails for valid str Description: ------------ Modern Russian alphabet contains 33 letters. Standard UTF8 rage covers 32 of most common, but misses one ('ё'). Standard U+0410 А … U+044F я Exceptions: U+0401 Ё U+0451 ё http://www.utf8-chartable.de/unicode-utf8-table.pl?start=1024 [а-я] range should include 'ё' (and [А-Я] — 'Ё') letter, but actually do not. Test script: --------------- $ cat cyr_io.php <?php $str = "еще"; $valid_string_expr = '/(*UTF8)[^а-я]/'; if (filter_var($str, FILTER_VALIDATE_REGEXP, array("options"=>array("regexp"=>"$valid_string_expr"))) === FALSE) echo ("string contains only cyrillic small letters\n"); else echo ("string contains NOT only cyrillic small letters\n"); $str = "ещё"; if (filter_var($str, FILTER_VALIDATE_REGEXP, array("options"=>array("regexp"=>"$valid_string_expr"))) === FALSE) echo ("string contains only cyrillic small letters\n"); else echo ("string contains NOT only cyrillic small letters\n"); ?> Expected result: ---------------- $ php cyr_io.php string contains only cyrillic small letters string contains only cyrillic small letters Actual result: -------------- $ php cyr_io.php string contains only cyrillic small letters string contains NOT only cyrillic small letters -- Edit bug report at https://bugs.php.net/bug.php?id=73251&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73251&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73251&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73251&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=73251&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=73251&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=73251&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=73251&r=needscript Try newer version: https://bugs.php.net/fix.php?id=73251&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=73251&r=support Expected behavior: https://bugs.php.net/fix.php?id=73251&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=73251&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=73251&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=73251&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73251&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=73251&r=dst IIS Stability: https://bugs.php.net/fix.php?id=73251&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=73251&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=73251&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=73251&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=73251&r=mysqlcfg

« previous php.bugs (#204469) next »