com php-src: use custom tolower() func which ignores locale: Zend/zend_operators.c

From: Date: Thu, 12 Dec 2013 08:47:40 +0000
Subject: com php-src: use custom tolower() func which ignores locale: Zend/zend_operators.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-76650@lists.php.net to get a copy of this message
Commit: 73b562084e8185d32551ebc0d008ba059a1f992e Author: Antony Dovgal <tony@daylessday.org> Sat, 31 Dec 2011 00:39:02 +0400 Committer: Antony Dovgal <tony2001@php.net> Thu, 12 Dec 2013 12:47:40 +0400 Parents: 8866508f88998ccbca0777f699bce316d4fed4b9 Branches: badoo-5..5_mysqlnd Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=73b562084e8185d32551ebc0d008ba059a1f992e Log: use custom tolower() func which ignores locale say hello to Turks and their moronic locale! Changed paths: M Zend/zend_operators.c Diff: diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 5c84deb2..509cd3d 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -37,9 +37,18 @@ static _locale_t current_locale = NULL; /* this is true global! may lead to strange effects on ZTS, but so may setlocale() */ #define zend_tolower(c) _tolower_l(c, current_locale) #else -#define zend_tolower(c) tolower(c) +#define zend_tolower(c) zend_ascii_tolower(c) #endif +inline static int zend_ascii_tolower(int i) +{ + if (64 < i && i < 91) { + return (i + 32); + } else { + return i; + } +} + #define TYPE_PAIR(t1,t2) (((t1) << 4) | (t2)) static const unsigned char tolower_map[256] = {

« previous php.cvs (#76650) next »