diff options
| author | Felipe Pena <felipe@php.net> | 2010-10-03 16:01:38 +0000 | 
|---|---|---|
| committer | Felipe Pena <felipe@php.net> | 2010-10-03 16:01:38 +0000 | 
| commit | 87a237342282fe036bb90486fdd6cdc392e16ac7 (patch) | |
| tree | 81f9130e01f6c9df10b9e9e52db890d74210477d /ext/pcre/php_pcre.c | |
| parent | 00f75c79ca9318cbd57590b4c01144369612b3c2 (diff) | |
| download | php-git-87a237342282fe036bb90486fdd6cdc392e16ac7.tar.gz | |
- Fixed bug #52971 (PCRE-Meta-Characters not working with utf-8)
#   In  PCRE,  by  default, \d, \D, \s, \S, \w, and \W recognize only ASCII
#       characters, even in UTF-8 mode. However, this can be changed by setting
#       the PCRE_UCP option.
Diffstat (limited to 'ext/pcre/php_pcre.c')
| -rw-r--r-- | ext/pcre/php_pcre.c | 9 | 
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index dcbc98fb85..ccb0a51c0e 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -350,7 +350,14 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(char *regex, int regex_le  			case 'S':	do_study  = 1;					break;  			case 'U':	coptions |= PCRE_UNGREEDY;		break;  			case 'X':	coptions |= PCRE_EXTRA;			break; -			case 'u':	coptions |= PCRE_UTF8;			break; +			case 'u':	coptions |= PCRE_UTF8; +	/* In  PCRE,  by  default, \d, \D, \s, \S, \w, and \W recognize only ASCII +       characters, even in UTF-8 mode. However, this can be changed by setting +       the PCRE_UCP option. */ +#ifdef PCRE_UCP +						coptions |= PCRE_UCP; +#endif			 +				break;  			/* Custom preg options */  			case 'e':	poptions |= PREG_REPLACE_EVAL;	break;  | 
