Skip to content

Commit

Permalink
Release version 1.1.26
Browse files Browse the repository at this point in the history
  • Loading branch information
marcovtwout committed Sep 30, 2022
1 parent bcb461e commit bda32f6
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Yii Framework Change Log
========================

Version 1.1.26 under development
Version 1.1.26 September 30, 2022
--------------------------------

- Enh #4386: Added support for PHP 8.1 (marcovtwout, JonathanArgentao, ivany4, csears123)
Expand Down
5 changes: 5 additions & 0 deletions UPGRADE
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ General upgrade instructions
issues to Yii issue tracker.


Upgrading from v1.1.26
----------------------

No significant changes were made.

Upgrading from v1.1.25
----------------------

Expand Down
2 changes: 1 addition & 1 deletion framework/YiiBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class YiiBase
*/
public static function getVersion()
{
return '1.1.26-dev';
return '1.1.26';
}

/**
Expand Down
50 changes: 41 additions & 9 deletions framework/yiilite.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class YiiBase
private static $_logger;
public static function getVersion()
{
return '1.1.26-dev';
return '1.1.26';
}
public static function createWebApplication($config=null)
{
Expand Down Expand Up @@ -1972,10 +1972,12 @@ protected function setReadOnly($value)
{
$this->_r=$value;
}
#[ReturnTypeWillChange]
public function getIterator()
{
return new CMapIterator($this->_d);
}
#[ReturnTypeWillChange]
public function count()
{
return $this->getCount();
Expand Down Expand Up @@ -2100,18 +2102,22 @@ public static function mergeArray($a,$b)
}
return $res;
}
#[ReturnTypeWillChange]
public function offsetExists($offset)
{
return $this->contains($offset);
}
#[ReturnTypeWillChange]
public function offsetGet($offset)
{
return $this->itemAt($offset);
}
#[ReturnTypeWillChange]
public function offsetSet($offset,$item)
{
$this->add($offset,$item);
}
#[ReturnTypeWillChange]
public function offsetUnset($offset)
{
$this->remove($offset);
Expand Down Expand Up @@ -2406,7 +2412,7 @@ public function getRestParams()
if($this->_restParams===null)
{
$result=array();
if (strncmp($this->getContentType(), 'application/json', 16) === 0)
if (strncmp((string)$this->getContentType(), 'application/json', 16) === 0)
$result = CJSON::decode($this->getRawBody(), $this->jsonAsArray);
elseif(function_exists('mb_parse_str'))
mb_parse_str($this->getRawBody(), $result);
Expand Down Expand Up @@ -2722,7 +2728,8 @@ public static function parseAcceptHeader($header)
$matches=array();
$accepts=array();
// get individual entries with their type, subtype, basetype and params
preg_match_all('/(?:\G\s?,\s?|^)(\w+|\*)\/(\w+|\*)(?:\+(\w+))?|(?<!^)\G(?:\s?;\s?(\w+)=([\w\.]+))/',$header,$matches);
if($header!==null)
preg_match_all('/(?:\G\s?,\s?|^)(\w+|\*)\/(\w+|\*)(?:\+(\w+))?|(?<!^)\G(?:\s?;\s?(\w+)=([\w\.]+))/',$header,$matches);
// the regexp should (in theory) always return an array of 6 arrays
if(count($matches)===6)
{
Expand Down Expand Up @@ -3312,7 +3319,7 @@ public function createPathInfo($params,$equal,$ampersand, $key=null)
if (is_array($v))
$pairs[]=$this->createPathInfo($v,$equal,$ampersand, $k);
else
$pairs[]=urlencode($k).$equal.urlencode($v);
$pairs[]=urlencode($k).$equal.urlencode((string)$v);
}
return implode($ampersand,$pairs);
}
Expand Down Expand Up @@ -4826,6 +4833,7 @@ public function gcSession($maxLifetime)
return true;
}
//------ The following methods enable CHttpSession to be CMap-like -----
#[ReturnTypeWillChange]
public function getIterator()
{
return new CHttpSessionIterator;
Expand All @@ -4834,6 +4842,7 @@ public function getCount()
{
return count($_SESSION);
}
#[ReturnTypeWillChange]
public function count()
{
return $this->getCount();
Expand Down Expand Up @@ -4878,18 +4887,22 @@ public function toArray()
{
return $_SESSION;
}
#[ReturnTypeWillChange]
public function offsetExists($offset)
{
return isset($_SESSION[$offset]);
}
#[ReturnTypeWillChange]
public function offsetGet($offset)
{
return isset($_SESSION[$offset]) ? $_SESSION[$offset] : null;
}
#[ReturnTypeWillChange]
public function offsetSet($offset,$item)
{
$_SESSION[$offset]=$item;
}
#[ReturnTypeWillChange]
public function offsetUnset($offset)
{
unset($_SESSION[$offset]);
Expand Down Expand Up @@ -4937,7 +4950,7 @@ class CHtml
private static $_modelNameConverter;
public static function encode($text)
{
return htmlspecialchars($text,ENT_QUOTES,Yii::app()->charset);
return htmlspecialchars((string)$text,ENT_QUOTES,Yii::app()->charset);
}
public static function decode($text)
{
Expand Down Expand Up @@ -5380,7 +5393,7 @@ public static function checkBoxList($name,$select,$data,$htmlOptions=array())
$checkAll=true;
foreach($data as $value=>$labelTitle)
{
$checked=!is_array($select) && !strcmp($value,$select) || is_array($select) && in_array($value,$select);
$checked=!is_array($select) && !strcmp($value,(string)$select) || is_array($select) && in_array($value,$select);
$checkAll=$checkAll && $checked;
$htmlOptions['value']=$value;
$htmlOptions['id']=$baseID.'_'.$id++;
Expand Down Expand Up @@ -5455,7 +5468,7 @@ public static function radioButtonList($name,$select,$data,$htmlOptions=array())
$id=0;
foreach($data as $value=>$labelTitle)
{
$checked=!strcmp($value,$select);
$checked=!strcmp($value,(string)$select);
$htmlOptions['value']=$value;
$htmlOptions['id']=$baseID.'_'.$id++;
$option=self::radioButton($name,$checked,$htmlOptions);
Expand Down Expand Up @@ -6034,7 +6047,7 @@ public static function listOptions($selection,$listData,&$htmlOptions)
else
{
$attributes=array('value'=>(string)$key,'encode'=>!$raw);
if(!is_array($selection) && !strcmp($key,$selection) || is_array($selection) && in_array($key,$selection))
if(!is_array($selection) && !strcmp($key,(string)$selection) || is_array($selection) && in_array($key,$selection))
$attributes['selected']='selected';
if(isset($options[$key]))
$attributes=array_merge($attributes,$options[$key]);
Expand Down Expand Up @@ -6116,7 +6129,7 @@ public static function resolveNameID($model,&$attribute,&$htmlOptions)
public static function resolveName($model,&$attribute)
{
$modelName=self::modelName($model);
if(($pos=strpos($attribute,'['))!==false)
if(($pos=strpos((string)$attribute,'['))!==false)
{
if($pos!==0) // e.g. name[a][b]
return $modelName.'['.substr($attribute,0,$pos).']'.substr($attribute,$pos);
Expand Down Expand Up @@ -6878,10 +6891,12 @@ protected function setReadOnly($value)
{
$this->_r=$value;
}
#[ReturnTypeWillChange]
public function getIterator()
{
return new CListIterator($this->_d);
}
#[ReturnTypeWillChange]
public function count()
{
return $this->getCount();
Expand Down Expand Up @@ -7002,14 +7017,17 @@ public function mergeWith($data)
elseif($data!==null)
throw new CException(Yii::t('yii','List data must be an array or an object implementing Traversable.'));
}
#[ReturnTypeWillChange]
public function offsetExists($offset)
{
return ($offset>=0 && $offset<$this->_c);
}
#[ReturnTypeWillChange]
public function offsetGet($offset)
{
return $this->itemAt($offset);
}
#[ReturnTypeWillChange]
public function offsetSet($offset,$item)
{
if($offset===null || $offset===$this->_c)
Expand All @@ -7020,6 +7038,7 @@ public function offsetSet($offset,$item)
$this->insertAt($offset,$item);
}
}
#[ReturnTypeWillChange]
public function offsetUnset($offset)
{
$this->removeAt($offset);
Expand Down Expand Up @@ -7526,23 +7545,28 @@ public function getSafeAttributeNames()
unset($attributes[$name]);
return array_keys($attributes);
}
#[ReturnTypeWillChange]
public function getIterator()
{
$attributes=$this->getAttributes();
return new CMapIterator($attributes);
}
#[ReturnTypeWillChange]
public function offsetExists($offset)
{
return property_exists($this,$offset);
}
#[ReturnTypeWillChange]
public function offsetGet($offset)
{
return $this->$offset;
}
#[ReturnTypeWillChange]
public function offsetSet($offset,$item)
{
$this->$offset=$item;
}
#[ReturnTypeWillChange]
public function offsetUnset($offset)
{
unset($this->$offset);
Expand Down Expand Up @@ -8446,6 +8470,7 @@ protected function instantiate($attributes)
$model=new $class(null);
return $model;
}
#[ReturnTypeWillChange]
public function offsetExists($offset)
{
return $this->__isset($offset);
Expand Down Expand Up @@ -8825,6 +8850,8 @@ protected function initConnection($pdo)
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
if($this->emulatePrepare!==null && constant('PDO::ATTR_EMULATE_PREPARES'))
$pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES,$this->emulatePrepare);
if(PHP_VERSION_ID >= 80100 && strncasecmp($this->getDriverName(),'sqlite',6)===0)
$pdo->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true);
if($this->charset!==null)
{
$driver=strtolower($pdo->getAttribute(PDO::ATTR_DRIVER_NAME));
Expand Down Expand Up @@ -10663,22 +10690,27 @@ public function __construct(&$data)
$this->_d=&$data;
$this->_i=0;
}
#[ReturnTypeWillChange]
public function rewind()
{
$this->_i=0;
}
#[ReturnTypeWillChange]
public function key()
{
return $this->_i;
}
#[ReturnTypeWillChange]
public function current()
{
return $this->_d[$this->_i];
}
#[ReturnTypeWillChange]
public function next()
{
$this->_i++;
}
#[ReturnTypeWillChange]
public function valid()
{
return $this->_i<count($this->_d);
Expand Down

0 comments on commit bda32f6

Please sign in to comment.