From f2b19fee7876708c7a7bb5cba6b7df682a9d2a53 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 31 Oct 2012 16:16:24 +0200 Subject: Multiple improvements to the URI class (thanks to @sourcejedi, PR #1326 for most of the ideas) - Renamed _detect_uri() and _parse_cli_args() to _parse_request_uri() and _parse_argv() respectively. - Added _parse_query_string() which allows us to detect the URI path from QUERY_STRING much like it is done in _parse_request_uri(). (the above changes also allow for a simpler logic in the case where the *uri_protocol* setting is not set to 'AUTO') - Updated application/config/config.php with a better list of the *uri_protocol* options. - Added _reset_query_string() to aid in re-processing from the QUERY_STRING (utilized in _parse_request_uri() and _parse_query_string()). --- application/config/config.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'application/config') diff --git a/application/config/config.php b/application/config/config.php index ab1508e7b..6867cee88 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -62,11 +62,12 @@ $config['index_page'] = 'index.php'; | URI string. The default setting of 'AUTO' works for most servers. | If your links do not seem to work, try one of the other delicious flavors: | -| 'AUTO' Default - auto detects -| 'PATH_INFO' Uses the PATH_INFO -| 'QUERY_STRING' Uses the QUERY_STRING -| 'REQUEST_URI' Uses the REQUEST_URI -| 'ORIG_PATH_INFO' Uses the ORIG_PATH_INFO +| 'AUTO' Default - auto detects +| 'CLI' or 'argv' Uses $_SERVER['argv'] (for php-cli only) +| 'REQUEST_URI' Uses $_SERVER['REQUEST_URI'] +| 'PATH_INFO' Uses $_SERVER['PATH_INFO'] +| 'QUERY_STRING' Uses $_SERVER['QUERY_STRING'] +| 'ORIG_PATH_INFO' Uses $_SERVER['ORIG_PATH_INFO'] | */ $config['uri_protocol'] = 'AUTO'; -- cgit v1.2.3-24-g4f1b From 30563ff7fd210f86103a5691f001441e76cfb646 Mon Sep 17 00:00:00 2001 From: Andrey Date: Thu, 1 Nov 2012 01:49:39 +0400 Subject: add russian in foreign_chars.php --- application/config/foreign_chars.php | 80 ++++++++++++++++++++++++------------ 1 file changed, 54 insertions(+), 26 deletions(-) (limited to 'application/config') diff --git a/application/config/foreign_chars.php b/application/config/foreign_chars.php index 6614caa31..1127c7cc8 100644 --- a/application/config/foreign_chars.php +++ b/application/config/foreign_chars.php @@ -40,44 +40,56 @@ $foreign_characters = array( '/Ä/' => 'Ae', '/Ü/' => 'Ue', '/Ö/' => 'Oe', - '/À|Á|Â|Ã|Ä|Å|Ǻ|Ā|Ă|Ą|Ǎ|Α|Ά|Ả|Ạ|Ầ|Ẫ|Ẩ|Ậ|Ằ|Ắ|Ẵ|Ẳ|Ặ/' => 'A', - '/à|á|â|ã|å|ǻ|ā|ă|ą|ǎ|ª|α|ά|ả|ạ|ầ|ấ|ẫ|ẩ|ậ|ằ|ắ|ẵ|ẳ|ặ/' => 'a', + '/À|Á|Â|Ã|Ä|Å|Ǻ|Ā|Ă|Ą|Ǎ|Α|Ά|Ả|Ạ|Ầ|Ẫ|Ẩ|Ậ|Ằ|Ắ|Ẵ|Ẳ|Ặ|А/' => 'A', + '/à|á|â|ã|å|ǻ|ā|ă|ą|ǎ|ª|α|ά|ả|ạ|ầ|ấ|ẫ|ẩ|ậ|ằ|ắ|ẵ|ẳ|ặ|а/' => 'a', + '/Б/' => 'B', + '/б/' => 'b', '/Ç|Ć|Ĉ|Ċ|Č/' => 'C', '/ç|ć|ĉ|ċ|č/' => 'c', + '/Д/' => 'D', + '/д/' => 'd', '/Ð|Ď|Đ|Δ/' => 'Dj', '/ð|ď|đ|δ/' => 'dj', - '/È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě|Ε|Έ|Ẽ|Ẻ|Ẹ|Ề|Ế|Ễ|Ể|Ệ/' => 'E', - '/è|é|ê|ë|ē|ĕ|ė|ę|ě|έ|ε|ẽ|ẻ|ẹ|ề|ế|ễ|ể|ệ/' => 'e', - '/Ĝ|Ğ|Ġ|Ģ|Γ/' => 'G', - '/ĝ|ğ|ġ|ģ|γ/' => 'g', + '/È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě|Ε|Έ|Ẽ|Ẻ|Ẹ|Ề|Ế|Ễ|Ể|Ệ|Е|Ё|Э/' => 'E', + '/è|é|ê|ë|ē|ĕ|ė|ę|ě|έ|ε|ẽ|ẻ|ẹ|ề|ế|ễ|ể|ệ|е|ё|э/' => 'e', + '/Ф/' => 'F', + '/ф/' => 'f', + '/Ĝ|Ğ|Ġ|Ģ|Γ|Г/' => 'G', + '/ĝ|ğ|ġ|ģ|γ|г/' => 'g', '/Ĥ|Ħ/' => 'H', '/ĥ|ħ/' => 'h', - '/Ì|Í|Î|Ï|Ĩ|Ī|Ĭ|Ǐ|Į|İ|Η|Ή|Ί|Ι|Ϊ|Ỉ|Ị/' => 'I', - '/ì|í|î|ï|ĩ|ī|ĭ|ǐ|į|ı|η|ή|ί|ι|ϊ|ỉ|ị/' => 'i', + '/Ì|Í|Î|Ï|Ĩ|Ī|Ĭ|Ǐ|Į|İ|Η|Ή|Ί|Ι|Ϊ|Ỉ|Ị|И|Й/' => 'I', + '/ì|í|î|ï|ĩ|ī|ĭ|ǐ|į|ı|η|ή|ί|ι|ϊ|ỉ|ị|и|й/' => 'i', '/Ĵ/' => 'J', '/ĵ/' => 'j', - '/Ķ|Κ/' => 'K', - '/ķ|κ/' => 'k', - '/Ĺ|Ļ|Ľ|Ŀ|Ł|Λ/' => 'L', - '/ĺ|ļ|ľ|ŀ|ł|λ/' => 'l', - '/Ñ|Ń|Ņ|Ň|Ν/' => 'N', - '/ñ|ń|ņ|ň|ʼn|ν/' => 'n', - '/Ò|Ó|Ô|Õ|Ō|Ŏ|Ǒ|Ő|Ơ|Ø|Ǿ|Ο|Ό|Ω|Ώ|Ỏ|Ọ|Ồ|Ố|Ỗ|Ổ|Ộ|Ờ|Ớ|Ỡ|Ở|Ợ/' => 'O', - '/ò|ó|ô|õ|ō|ŏ|ǒ|ő|ơ|ø|ǿ|º|ο|ό|ω|ώ|ỏ|ọ|ồ|ố|ỗ|ổ|ộ|ờ|ớ|ỡ|ở|ợ/' => 'o', - '/Ŕ|Ŗ|Ř|Ρ/' => 'R', - '/ŕ|ŗ|ř|ρ/' => 'r', - '/Ś|Ŝ|Ş|Ș|Š|Σ/' => 'S', - '/ś|ŝ|ş|ș|š|ſ|σ|ς/' => 's', - '/Ț|Ţ|Ť|Ŧ|τ/' => 'T', - '/ț|ţ|ť|ŧ/' => 't', - '/Ù|Ú|Û|Ũ|Ū|Ŭ|Ů|Ű|Ų|Ư|Ǔ|Ǖ|Ǘ|Ǚ|Ǜ|Ũ|Ủ|Ụ|Ừ|Ứ|Ữ|Ử|Ự/' => 'U', - '/ù|ú|û|ũ|ū|ŭ|ů|ű|ų|ư|ǔ|ǖ|ǘ|ǚ|ǜ|υ|ύ|ϋ|ủ|ụ|ừ|ứ|ữ|ử|ự/' => 'u', + '/Ķ|Κ|К/' => 'K', + '/ķ|κ|к/' => 'k', + '/Ĺ|Ļ|Ľ|Ŀ|Ł|Λ|Л/' => 'L', + '/ĺ|ļ|ľ|ŀ|ł|λ|л/' => 'l', + '/М/' => 'M', + '/м/' => 'm', + '/Ñ|Ń|Ņ|Ň|Ν|Н/' => 'N', + '/ñ|ń|ņ|ň|ʼn|ν|н/' => 'n', + '/Ò|Ó|Ô|Õ|Ō|Ŏ|Ǒ|Ő|Ơ|Ø|Ǿ|Ο|Ό|Ω|Ώ|Ỏ|Ọ|Ồ|Ố|Ỗ|Ổ|Ộ|Ờ|Ớ|Ỡ|Ở|Ợ|О/' => 'O', + '/ò|ó|ô|õ|ō|ŏ|ǒ|ő|ơ|ø|ǿ|º|ο|ό|ω|ώ|ỏ|ọ|ồ|ố|ỗ|ổ|ộ|ờ|ớ|ỡ|ở|ợ|о/' => 'o', + '/П/' => 'P', + '/п/' => 'p', + '/Ŕ|Ŗ|Ř|Ρ|Р/' => 'R', + '/ŕ|ŗ|ř|ρ|р/' => 'r', + '/Ś|Ŝ|Ş|Ș|Š|Σ|С/' => 'S', + '/ś|ŝ|ş|ș|š|ſ|σ|ς|с/' => 's', + '/Ț|Ţ|Ť|Ŧ|τ|Т/' => 'T', + '/ț|ţ|ť|ŧ|т/' => 't', + '/Ù|Ú|Û|Ũ|Ū|Ŭ|Ů|Ű|Ų|Ư|Ǔ|Ǖ|Ǘ|Ǚ|Ǜ|Ũ|Ủ|Ụ|Ừ|Ứ|Ữ|Ử|Ự|У/' => 'U', + '/ù|ú|û|ũ|ū|ŭ|ů|ű|ų|ư|ǔ|ǖ|ǘ|ǚ|ǜ|υ|ύ|ϋ|ủ|ụ|ừ|ứ|ữ|ử|ự|у/' => 'u', '/Ý|Ÿ|Ŷ|Υ|Ύ|Ϋ|Ỳ|Ỹ|Ỷ|Ỵ/' => 'Y', '/ý|ÿ|ŷ|ỳ|ỹ|ỷ|ỵ/' => 'y', + '/В/' => 'V', + '/в/' => 'v', '/Ŵ/' => 'W', '/ŵ/' => 'w', - '/Ź|Ż|Ž|Ζ/' => 'Z', - '/ź|ż|ž|ζ/' => 'z', + '/Ź|Ż|Ž|Ζ|З/' => 'Z', + '/ź|ż|ž|ζ|з/' => 'z', '/Æ|Ǽ/' => 'AE', '/ß/'=> 'ss', '/IJ/' => 'IJ', @@ -89,6 +101,22 @@ $foreign_characters = array( '/β/' => 'v', '/μ/' => 'm', '/ψ/' => 'ps', + '/Ж/'=>'ZH', + '/ж/'=>'zh', + '/Х/'=>'KH', + '/х/'=>'kh', + '/Ц/'=>'TC', + '/ц/'=>'tc', + '/Ч/'=>'CH', + '/ч/'=>'ch', + '/Ш/'=>'SH', + '/ш/'=>'sh', + '/Щ/'=>'SHCH', + '/щ/'=>'shch', + '/Ю/'=>'IU', + '/ю/'=>'iu', + '/Я/'=>'IA', + '/я/'=>'ia' ); /* End of file foreign_chars.php */ -- cgit v1.2.3-24-g4f1b From 3b72eb58e61581b7e92012a322be48e216491d7c Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 1 Nov 2012 00:45:26 +0200 Subject: Changed URI auto-detection to try PATH_INFO first (thanks to @sourcejedi, PR #1326) Up until PHP 5.2.4 (which is our new lowest requirement), there was a bug related to PATH_INFO which made REQUEST_URI a more reliable choice. This is now no longer the case, see https://bugs.php.net/bug.php?id=31892 for more details. Also removed ORIG_PATH_INFO from the suggested alternatives for uri_protocol in application/config/config.php as it will not exist in most of PHP's recent versions and is pointless when you can use PATH_INFO anyway. --- application/config/config.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'application/config') diff --git a/application/config/config.php b/application/config/config.php index 6867cee88..0562953b0 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -64,10 +64,9 @@ $config['index_page'] = 'index.php'; | | 'AUTO' Default - auto detects | 'CLI' or 'argv' Uses $_SERVER['argv'] (for php-cli only) -| 'REQUEST_URI' Uses $_SERVER['REQUEST_URI'] | 'PATH_INFO' Uses $_SERVER['PATH_INFO'] +| 'REQUEST_URI' Uses $_SERVER['REQUEST_URI'] | 'QUERY_STRING' Uses $_SERVER['QUERY_STRING'] -| 'ORIG_PATH_INFO' Uses $_SERVER['ORIG_PATH_INFO'] | */ $config['uri_protocol'] = 'AUTO'; -- cgit v1.2.3-24-g4f1b From 948f0218b845e68ea162322dae3a2f5fe7e4a913 Mon Sep 17 00:00:00 2001 From: sa Date: Thu, 1 Nov 2012 16:27:02 +0400 Subject: russian second letter in lowercase, foreign_chars.php --- application/config/foreign_chars.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'application/config') diff --git a/application/config/foreign_chars.php b/application/config/foreign_chars.php index 1127c7cc8..5a2bb0cf7 100644 --- a/application/config/foreign_chars.php +++ b/application/config/foreign_chars.php @@ -101,21 +101,21 @@ $foreign_characters = array( '/β/' => 'v', '/μ/' => 'm', '/ψ/' => 'ps', - '/Ж/'=>'ZH', + '/Ж/'=>'Zh', '/ж/'=>'zh', - '/Х/'=>'KH', + '/Х/'=>'Kh', '/х/'=>'kh', - '/Ц/'=>'TC', + '/Ц/'=>'Tc', '/ц/'=>'tc', - '/Ч/'=>'CH', + '/Ч/'=>'Ch', '/ч/'=>'ch', - '/Ш/'=>'SH', + '/Ш/'=>'Sh', '/ш/'=>'sh', - '/Щ/'=>'SHCH', + '/Щ/'=>'Shch', '/щ/'=>'shch', - '/Ю/'=>'IU', + '/Ю/'=>'Iu', '/ю/'=>'iu', - '/Я/'=>'IA', + '/Я/'=>'Ia', '/я/'=>'ia' ); -- cgit v1.2.3-24-g4f1b