@@ -41,7 +41,7 @@ class YiiBase
4141 private static $ _logger ;
4242 public static function getVersion ()
4343 {
44- return '1.1.28-dev ' ;
44+ return '1.1.28 ' ;
4545 }
4646 public static function createWebApplication ($ config =null )
4747 {
@@ -2553,9 +2553,22 @@ protected function decodePathInfo($pathInfo)
25532553 }
25542554 else
25552555 {
2556- return utf8_encode ($ pathInfo );
2556+ return $ this -> utf8Encode ($ pathInfo );
25572557 }
25582558 }
2559+ private function utf8Encode ($ s )
2560+ {
2561+ $ s .=$ s ;
2562+ $ len =strlen ($ s );
2563+ for ($ i =$ len >>1 ,$ j =0 ; $ i <$ len ; ++$ i ,++$ j ) {
2564+ switch (true ) {
2565+ case $ s [$ i ] < "\x80" : $ s [$ j ] = $ s [$ i ]; break ;
2566+ case $ s [$ i ] < "\xC0" : $ s [$ j ] = "\xC2" ; $ s [++$ j ] = $ s [$ i ]; break ;
2567+ default : $ s [$ j ] = "\xC3" ; $ s [++$ j ] = chr (ord ($ s [$ i ]) - 64 ); break ;
2568+ }
2569+ }
2570+ return substr ($ s , 0 , $ j );
2571+ }
25592572 public function getRequestUri ()
25602573 {
25612574 if ($ this ->_requestUri ===null )
@@ -4326,7 +4339,7 @@ public function logout($destroySession=true)
43264339 if ($ this ->identityCookie !==null )
43274340 {
43284341 $ cookie =$ this ->createIdentityCookie ($ this ->getStateKeyPrefix ());
4329- $ cookie ->value =null ;
4342+ $ cookie ->value ='' ;
43304343 $ cookie ->expire =0 ;
43314344 Yii::app ()->getRequest ()->getCookies ()->add ($ cookie ->name ,$ cookie );
43324345 }
@@ -5915,7 +5928,7 @@ public static function listData($models,$valueField,$textField,$groupField='')
59155928 public static function value ($ model ,$ attribute ,$ defaultValue =null )
59165929 {
59175930 if (is_scalar ($ attribute ) || $ attribute ===null )
5918- foreach (explode ('. ' ,$ attribute ) as $ name )
5931+ foreach (explode ('. ' ,( string ) $ attribute ) as $ name )
59195932 {
59205933 if (is_object ($ model ))
59215934 {
@@ -10443,9 +10456,9 @@ protected function validateAttribute($object,$attribute)
1044310456 return ;
1044410457 }
1044510458 if (function_exists ('mb_strlen ' ) && $ this ->encoding !==false )
10446- $ length =mb_strlen ($ value , $ this ->encoding ? $ this ->encoding : Yii::app ()->charset );
10459+ $ length =mb_strlen (( string ) $ value , $ this ->encoding ? $ this ->encoding : Yii::app ()->charset );
1044710460 else
10448- $ length =strlen ($ value );
10461+ $ length =strlen (( string ) $ value );
1044910462 if ($ this ->min !==null && $ length <$ this ->min )
1045010463 {
1045110464 $ message =$ this ->tooShort !==null ?$ this ->tooShort :Yii::t ('yii ' ,'{attribute} is too short (minimum is {min} characters). ' );
0 commit comments