Skip to content

Commit b7e017a

Browse files
author
Till Brehm
committed
Implemented #5651 Make ISPConfig code base compatible with PHP 7.4
1 parent 0a1340a commit b7e017a

File tree

12 files changed

+56
-244
lines changed

12 files changed

+56
-244
lines changed

install/lib/install.lib.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -691,8 +691,7 @@ function ini_to_array($ini) {
691691

692692

693693
//* Converts a config array to a string
694-
function array_to_ini($config_array = '') {
695-
if($config_array == '') $config_array = $this->config;
694+
function array_to_ini($config_array) {
696695
$content = '';
697696
foreach($config_array as $section => $data) {
698697
$content .= "[$section]\n";

install/lib/installer_base.lib.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3228,6 +3228,9 @@ protected function get_template_file($tLocal, $tRf=false, $tDBCred=false) {
32283228
* @return bool
32293229
*/
32303230
protected function write_config_file($tConf, $tContents) {
3231+
3232+
$args = func_get_args();
3233+
32313234
// Backup config file before writing new contents and stat file
32323235
if ( is_file($tConf) ) {
32333236
$stat = exec('stat -c \'%a %U %G\' '.escapeshellarg($tConf), $output, $res);
@@ -3241,10 +3244,9 @@ protected function write_config_file($tConf, $tContents) {
32413244
}
32423245

32433246
wf($tConf, $tContents); // write file
3244-
32453247
if (func_num_args() >= 4) // override rights and/or ownership
32463248
{
3247-
$args = func_get_args();
3249+
32483250
$output = array_slice($args, 2);
32493251

32503252
switch (sizeof($output)) {

install/lib/mysql.lib.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ private function _setCharset() {
192192
}
193193

194194
private function _query($sQuery = '') {
195+
196+
$aArgs = func_get_args();
195197
$this->do_connect();
196198

197199
if ($sQuery == '') {
@@ -227,7 +229,6 @@ private function _query($sQuery = '') {
227229
}
228230
} while($ok == false);
229231

230-
$aArgs = func_get_args();
231232
$sQuery = call_user_func_array(array(&$this, '_build_query_string'), $aArgs);
232233

233234
$this->_iQueryId = mysqli_query($this->_iConnId, $sQuery);
@@ -283,9 +284,11 @@ public function query($sQuery = '') {
283284
* @return array result row or NULL if none found
284285
*/
285286
public function queryOneRecord($sQuery = '') {
286-
if(!preg_match('/limit \d+\s*,\s*\d+$/i', $sQuery)) $sQuery .= ' LIMIT 0,1';
287-
287+
288288
$aArgs = func_get_args();
289+
290+
if(!preg_match('/limit \d+\s*,\s*\d+$/i', $sQuery)) $sQuery .= ' LIMIT 0,1';
291+
289292
$oResult = call_user_func_array(array(&$this, 'query'), $aArgs);
290293
if(!$oResult) return null;
291294

@@ -956,7 +959,7 @@ public function get() {
956959

957960
if(!is_array($this->aLimitedData)) return $aItem;
958961

959-
if(list($vKey, $aItem) = each($this->aLimitedData)) {
962+
foreach($this->aLimitedData as $vKey => $aItem) {
960963
if(!$aItem) $aItem = null;
961964
}
962965
return $aItem;

interface/lib/classes/cmstree.inc.php

Lines changed: 0 additions & 117 deletions
This file was deleted.

interface/lib/classes/db_mysql.inc.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,8 @@ private function securityScan($string) {
258258

259259
private function _query($sQuery = '') {
260260
global $app;
261+
262+
$aArgs = func_get_args();
261263

262264
if ($sQuery == '') {
263265
$this->_sqlerror('Keine Anfrage angegeben / No query given');
@@ -297,7 +299,6 @@ private function _query($sQuery = '') {
297299
}
298300
} while($ok == false);
299301

300-
$aArgs = func_get_args();
301302
$sQuery = call_user_func_array(array(&$this, '_build_query_string'), $aArgs);
302303
$this->securityScan($sQuery);
303304
$this->_iQueryId = mysqli_query($this->_iConnId, $sQuery);
@@ -353,9 +354,11 @@ public function query($sQuery = '') {
353354
* @return array result row or NULL if none found
354355
*/
355356
public function queryOneRecord($sQuery = '') {
357+
358+
$aArgs = func_get_args();
359+
356360
if(!preg_match('/limit \d+\s*(,\s*\d+)?$/i', $sQuery)) $sQuery .= ' LIMIT 0,1';
357361

358-
$aArgs = func_get_args();
359362
$oResult = call_user_func_array(array(&$this, 'query'), $aArgs);
360363
if(!$oResult) return null;
361364

@@ -1300,7 +1303,7 @@ public function get() {
13001303

13011304
if(!is_array($this->aLimitedData)) return $aItem;
13021305

1303-
if(list($vKey, $aItem) = each($this->aLimitedData)) {
1306+
foreach($this->aLimitedData as $vKey => $aItem) {
13041307
if(!$aItem) $aItem = null;
13051308
}
13061309
return $aItem;

0 commit comments

Comments
 (0)