Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dev Fixed PHP7 issue: Uninitialized string offset.
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,4 +52,40 @@ protected function normalizeRequest(){ | |
} | ||
} | ||
|
||
|
||
public function getPathInfo() | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
SamMousa
via email
Author
Contributor
|
||
{ | ||
if($this->_pathInfo===null) | ||
{ | ||
$pathInfo=$this->getRequestUri(); | ||
|
||
if(($pos=strpos($pathInfo,'?'))!==false) | ||
$pathInfo=substr($pathInfo,0,$pos); | ||
|
||
$pathInfo=$this->decodePathInfo($pathInfo); | ||
|
||
$scriptUrl=$this->getScriptUrl(); | ||
$baseUrl=$this->getBaseUrl(); | ||
if(strpos($pathInfo,$scriptUrl)===0) | ||
$pathInfo=substr($pathInfo,strlen($scriptUrl)); | ||
elseif($baseUrl==='' || strpos($pathInfo,$baseUrl)===0) | ||
$pathInfo=substr($pathInfo,strlen($baseUrl)); | ||
elseif(strpos($_SERVER['PHP_SELF'],$scriptUrl)===0) | ||
$pathInfo=substr($_SERVER['PHP_SELF'],strlen($scriptUrl)); | ||
else | ||
throw new CException(Yii::t('yii','CHttpRequest is unable to determine the path info of the request.')); | ||
|
||
if($pathInfo==='/') | ||
$pathInfo=''; | ||
elseif(!empty($pathInfo) && $pathInfo[0]==='/') | ||
$pathInfo=substr($pathInfo,1); | ||
|
||
if(($posEnd=strlen($pathInfo)-1)>0 && $pathInfo[$posEnd]==='/') | ||
$pathInfo=substr($pathInfo,0,$posEnd); | ||
|
||
$this->_pathInfo=$pathInfo; | ||
} | ||
return $this->_pathInfo; | ||
} | ||
|
||
} |
Please add documentation.