mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-03-28 17:42:57 +01: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:
@@ -23,7 +23,7 @@
|
||||
|
||||
class c13y_internal
|
||||
{
|
||||
function c13y_internal()
|
||||
function __construct()
|
||||
{
|
||||
add_event_handler('list_check_integrity', array(&$this, 'c13y_version'));
|
||||
add_event_handler('list_check_integrity', array(&$this, 'c13y_exif'));
|
||||
|
||||
@@ -27,7 +27,7 @@ class check_integrity
|
||||
var $retrieve_list;
|
||||
var $build_ignore_list;
|
||||
|
||||
function check_integrity()
|
||||
function __construct()
|
||||
{
|
||||
$this->ignore_list = array();
|
||||
$this->retrieve_list = array();
|
||||
|
||||
@@ -174,10 +174,7 @@ UPDATE '.PREFIX_TABLE.'user_infos
|
||||
// Deactivate all templates
|
||||
function deactivate_templates()
|
||||
{
|
||||
$query = '
|
||||
UPDATE '.PREFIX_TABLE.'config
|
||||
SET value = \''. array() .'\'
|
||||
WHERE param = \'extents_for_templates\';';
|
||||
conf_update_param('extents_for_templates', array());
|
||||
}
|
||||
|
||||
// Check access rights
|
||||
@@ -322,4 +319,4 @@ function upgrade_db_connect()
|
||||
my_error(l10n($e->getMessage()), true);
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -30,7 +30,7 @@ class languages
|
||||
/**
|
||||
* Initialize $fs_languages and $db_languages
|
||||
*/
|
||||
function languages($target_charset = null)
|
||||
function __construct($target_charset = null)
|
||||
{
|
||||
$this->get_fs_languages($target_charset);
|
||||
}
|
||||
@@ -408,4 +408,4 @@ UPDATE '.USER_INFOS_TABLE.'
|
||||
return strcmp(strtolower($a['extension_name']), strtolower($b['extension_name']));
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -212,7 +212,7 @@
|
||||
// Note that no real action is taken, if the archive does not exist it is not
|
||||
// created. Use create() for that.
|
||||
// --------------------------------------------------------------------------------
|
||||
function PclZip($p_zipname)
|
||||
function __construct($p_zipname)
|
||||
{
|
||||
|
||||
// ----- Tests the zlib
|
||||
|
||||
@@ -69,7 +69,7 @@ class plugins
|
||||
/**
|
||||
* Initialize $fs_plugins and $db_plugins_by_id
|
||||
*/
|
||||
function plugins()
|
||||
function __construct()
|
||||
{
|
||||
$this->get_fs_plugins();
|
||||
|
||||
@@ -716,4 +716,4 @@ DELETE FROM '. PLUGINS_TABLE .'
|
||||
$this->fs_plugins = $active_plugins + $inactive_plugins + $not_installed;
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -33,7 +33,7 @@ class tabsheet
|
||||
$name is the tabsheet's name inside the template .tpl file
|
||||
$titlename in the template is affected by $titlename value
|
||||
*/
|
||||
function tabsheet($name = 'TABSHEET', $titlename = 'TABSHEET_TITLE')
|
||||
function __construct($name = 'TABSHEET', $titlename = 'TABSHEET_TITLE')
|
||||
{
|
||||
$this->sheets = array();
|
||||
$this->uniqid = null;
|
||||
|
||||
@@ -60,7 +60,7 @@ class themes
|
||||
/**
|
||||
* Initialize $fs_themes and $db_themes_by_id
|
||||
*/
|
||||
function themes()
|
||||
function __construct()
|
||||
{
|
||||
$this->get_fs_themes();
|
||||
|
||||
@@ -736,4 +736,4 @@ SELECT
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
//----------------------------------------------------------- include
|
||||
define('PHPWG_ROOT_PATH','./');
|
||||
|
||||
@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
|
||||
// precaution to prevent someone trying to break out of a SQL statement.
|
||||
@@ -529,4 +529,4 @@ if (count($infos) != 0 )
|
||||
|
||||
//----------------------------------------------------------- html code display
|
||||
$template->pparse('install');
|
||||
?>
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user