mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-11 19:23:01 +02:00
bug #385 compatibility with PHP7
* replace old-style constructor with PHP5-style constructor (__construct) * do not call set_magic_quotes_runtime() any longer * avoid automatic conversion from array to string
This commit is contained in:
@@ -26,7 +26,7 @@ defined('PHPWG_ROOT_PATH') or trigger_error('Hacking attempt!', E_USER_ERROR);
|
||||
// determine the initial instant to indicate the generation time of this page
|
||||
$t2 = microtime(true);
|
||||
|
||||
@set_magic_quotes_runtime(0); // Disable magic_quotes_runtime
|
||||
// @set_magic_quotes_runtime(0); // Disable magic_quotes_runtime
|
||||
|
||||
//
|
||||
// addslashes to vars if magic_quotes_gpc is off this is a security
|
||||
|
||||
@@ -56,7 +56,7 @@ class PwgError
|
||||
private $_code;
|
||||
private $_codeText;
|
||||
|
||||
function PwgError($code, $codeText)
|
||||
function __construct($code, $codeText)
|
||||
{
|
||||
if ($code>=400 and $code<600)
|
||||
{
|
||||
@@ -89,7 +89,7 @@ class PwgNamedArray
|
||||
* @param xmlAttributes array of sub-item attributes that will be encoded as
|
||||
* xml attributes instead of xml child elements
|
||||
*/
|
||||
function PwgNamedArray($arr, $itemName, $xmlAttributes=array() )
|
||||
function __construct($arr, $itemName, $xmlAttributes=array() )
|
||||
{
|
||||
$this->_content = $arr;
|
||||
$this->_itemName = $itemName;
|
||||
@@ -115,7 +115,7 @@ class PwgNamedStruct
|
||||
* encoded as xml attributes (if null - automatically prefer xml attributes
|
||||
* whenever possible)
|
||||
*/
|
||||
function PwgNamedStruct($content, $xmlAttributes=null, $xmlElements=null )
|
||||
function __construct($content, $xmlAttributes=null, $xmlElements=null )
|
||||
{
|
||||
$this->_content = $content;
|
||||
if ( isset($xmlAttributes) )
|
||||
@@ -236,7 +236,7 @@ class PwgServer
|
||||
|
||||
var $_methods = array();
|
||||
|
||||
function PwgServer()
|
||||
function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -688,4 +688,4 @@ Request format: ".@$this->_requestFormat." Response format: ".@$this->_responseF
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user