Manualna aktualizacja pliku core.php do wersji 3.1.x:
Plik: admin\sources\base\core.php
Znajdź:
/**
* Returns the class name to be instantiated, the class file will already be included
*
* @param string $filePath File location of the class
* @param string $className Name of the class
* @param string $app Application (defaults to 'core')
* @return string Class Name
*/
Dodaj nad tym:
static public function safeUnserialize( $serialized )
{
// unserialize will return false for object declared with small cap o
// as well as if there is any ws between O and :
if ( is_string( $serialized ) && strpos( $serialized, "\0" ) === false )
{
if ( strpos( $serialized, 'O:' ) === false )
{
// the easy case, nothing to worry about
// let unserialize do the job
return @unserialize( $serialized );
}
else if ( ! preg_match('/(^|;|{|})O:[+\-0-9]+:"/', $serialized ) )
{
// in case we did have a string with O: in it,
// but it was not a true serialized object
return @unserialize( $serialized );
}
}
return false;
}
Wyszukaj:
if ( $iteration >= 20 )
{
return $input;
}
Dodaj pod tym:
if ( ! is_array( $data ) )
{
return $input;
}
Wyszukaj:
if ( is_array( $value ) )
{
$value = serialize( $value );
}
Zamień na:
if ( is_array( $value ) )
{
$value = json_encode( $value );
}
Wyszukaj:
static public function get($name)
{
/* Check internal data first */
if ( isset( self::$_cookiesSet[ $name ] ) )
{
return self::$_cookiesSet[ $name ];
}
else if ( isset( $_COOKIE[ipsRegistry::$settings['cookie_id'].$name] ) )
{
$_value = $_COOKIE[ ipsRegistry::$settings['cookie_id'].$name ];
if ( substr( $_value, 0, 2 ) == 'a:' )
{
return unserialize( stripslashes( urldecode( $_value ) ) );
}
else
{
return IPSText::parseCleanValue( urldecode( $_value ) );
}
}
else
{
return FALSE;
}
}
Zamień na:
static public function get($name)
{
/* Check internal data first */
if ( isset( self::$_cookiesSet[ $name ] ) )
{
return self::$_cookiesSet[ $name ];
}
else if ( isset( $_COOKIE[ipsRegistry::$settings['cookie_id'].$name] ) )
{
$_value = $_COOKIE[ ipsRegistry::$settings['cookie_id'].$name ];
$_couldBeJson = stripslashes( urldecode( $_value ) );
$_test = json_decode( $_couldBeJson, true );
if ( is_array( $_test ) )
{
return IPSLib::parseIncomingRecursively( $_test );
}
else
{
return IPSText::parseCleanValue( urldecode( $_value ) );
}
}
else
{
return FALSE;
}
}
Wyszukaj:
static public function parseCleanKey($key)
{
if ( $key == "" )
{
return "";
}
Zamień na:
static public function parseCleanKey($key)
{
if ( $key === "" )
{
return "";
}