Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Fix for bug #18556 #79

Closed
wants to merge 1 commit into from

3 participants

netnet Ævar Arnfjörð Bjarmason Account for PHP Pull Requests
netnet
netnet commented May 10, 2012

Patch to avoid locale-aware lowercasing for letter 'I' in zend_str_tolower() and friends.

Ævar Arnfjörð Bjarmason
avar commented July 02, 2012

This fix looks like a crazy hack, the real solution to this is to change the comparison functions for identifiers not to be locale dependent, not hack around a specific locale and its treatment of the letter "i" in a low-level copying function.

Account for PHP Pull Requests
Collaborator

Comment on behalf of stas at php.net:

other fix will be done.

Account for PHP Pull Requests php-pulls closed this July 14, 2012
Account for PHP Pull Requests php-pulls referenced this pull request from a commit April 01, 2013
Dmitry Stogov Merge branch 'PHP-5.5'
* PHP-5.5:
  Fixed issue #79 (Optimization Problem/Bug)
  fix coverage data for the opcache optimizer
71a45be
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

May 10, 2012
Avoid locale-aware lowercasing for letter 'I' (ref. bug #18556) 0515360
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 3 additions and 2 deletions. Show diff stats Hide diff stats

  1. 5  Zend/zend_operators.c
5  Zend/zend_operators.c
@@ -1907,7 +1907,8 @@ ZEND_API char *zend_str_tolower_copy(char *dest, const char *source, unsigned in
1907 1907
 	register unsigned char *end = str + length;
1908 1908
 
1909 1909
 	while (str < end) {
1910  
-		*result++ = zend_tolower((int)*str++);
  1910
+		*result++ = (*str == 'I') ? 'i' : zend_tolower((int)*str);
  1911
+		str++;
1911 1912
 	}
1912 1913
 	*result = '\0';
1913 1914
 
@@ -1927,7 +1928,7 @@ ZEND_API void zend_str_tolower(char *str, unsigned int length) /* {{{ */
1927 1928
 	register unsigned char *end = p + length;
1928 1929
 
1929 1930
 	while (p < end) {
1930  
-		*p = zend_tolower((int)*p);
  1931
+		*p = (*p == 'I') ? 'i' : zend_tolower((int)*p);
1931 1932
 		p++;
1932 1933
 	}
1933 1934
 }
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.