Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

(Fixes issue 3097)

  • Loading branch information...
commit f2dd7bee6c3c170c5dca637a0acbc395e353d420 1 parent acf6d62
keyboard.idol@gmail.com authored
Showing with 13 additions and 11 deletions.
  1. +1 −0  CHANGELOG
  2. +12 −11 framework/web/CHttpRequest.php
View
1  CHANGELOG
@@ -12,6 +12,7 @@ Version 1.1.10 work in progress
- Bug #3096: Fixed the bug when reporting an error and CHtml is not loaded (mdomba)
- Bug #3103: Fixed the bug that CActiveForm->error() was not overloading htmlOptions (mdomba)
- Enh #3063: Gii, when generating models, tableNames will be checked against reserved PHP keywords when '*' is used (mdomba)
+- Enh #3097: Added CHttpRequest::decodePathInfo() (Y!!)
- Enh #3101: The methods of CSecurityManager do now work correctly for the case that mbstring.func_overload is in effect (Y!!)
- Enh #3112: Fixed the exception error display on ajax calls when YII_DEBUG is true (mdomba)
- Enh: Added CActiveForm::validateTabular() to simplify ajax validation for tabular input (mdomba)
View
23 framework/web/CHttpRequest.php
@@ -383,7 +383,7 @@ public function getPathInfo()
if(($pos=strpos($pathInfo,'?'))!==false)
$pathInfo=substr($pathInfo,0,$pos);
- $pathInfo=$this->urldecode($pathInfo);
+ $pathInfo=$this->decodePathInfo($pathInfo);
$scriptUrl=$this->getScriptUrl();
$baseUrl=$this->getBaseUrl();
@@ -402,15 +402,16 @@ public function getPathInfo()
}
/**
- * Improved variant of urldecode.
- * Properly decodes both UTF-8 and ISO-8859-1 encoded URIs.
- *
- * @param string $str encoded string
- * @return string decoded string
+ * Decodes the path info.
+ * This method is an improved variant of the native urldecode() function and used in {@link getPathInfo getPathInfo()} to
+ * decode the path part of the request URI. You may override this method to change the way the path info is being decoded.
+ * @param string $pathInfo encoded path info
+ * @return string decoded path info
+ * @since 1.1.10
*/
- private function urldecode($str)
+ protected function decodePathInfo($pathInfo)
{
- $str = urldecode($str);
+ $pathInfo = urldecode($pathInfo);
// is it UTF-8?
// http://w3.org/International/questions/qa-forms-utf-8.html
@@ -423,13 +424,13 @@ private function urldecode($str)
| \xF0[\x90-\xBF][\x80-\xBF]{2} # planes 1-3
| [\xF1-\xF3][\x80-\xBF]{3} # planes 4-15
| \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16
- )*$%xs', $str))
+ )*$%xs', $pathInfo))
{
- return $str;
+ return $pathInfo;
}
else
{
- return utf8_encode($str);
+ return utf8_encode($pathInfo);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.