diff --git a/install/lib/install.lib.php b/install/lib/install.lib.php index 4aa4d196c7cdc37e0bf2d88578779bd80c1acc07..9312a8981aefd6059df70ae4c5a4cc40b49b747d 100644 --- a/install/lib/install.lib.php +++ b/install/lib/install.lib.php @@ -691,8 +691,7 @@ function ini_to_array($ini) { //* Converts a config array to a string -function array_to_ini($config_array = '') { - if($config_array == '') $config_array = $this->config; +function array_to_ini($config_array) { $content = ''; foreach($config_array as $section => $data) { $content .= "[$section]\n"; diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php index 5ca16cc6741e0ef483e8139ed849904ca1198bb4..bc9ed26e1847eab11b04543228d71d9fb43a5e32 100644 --- a/install/lib/installer_base.lib.php +++ b/install/lib/installer_base.lib.php @@ -3228,6 +3228,9 @@ class installer_base { * @return bool */ protected function write_config_file($tConf, $tContents) { + + $args = func_get_args(); + // Backup config file before writing new contents and stat file if ( is_file($tConf) ) { $stat = exec('stat -c \'%a %U %G\' '.escapeshellarg($tConf), $output, $res); @@ -3241,10 +3244,9 @@ class installer_base { } wf($tConf, $tContents); // write file - if (func_num_args() >= 4) // override rights and/or ownership { - $args = func_get_args(); + $output = array_slice($args, 2); switch (sizeof($output)) { diff --git a/install/lib/mysql.lib.php b/install/lib/mysql.lib.php index 2528100cc51c8fc0bd096d1ef28a168a4cf42fec..3e091d10b8ec6775fca573984a40a153ed9635c2 100644 --- a/install/lib/mysql.lib.php +++ b/install/lib/mysql.lib.php @@ -192,6 +192,8 @@ class db } private function _query($sQuery = '') { + + $aArgs = func_get_args(); $this->do_connect(); if ($sQuery == '') { @@ -227,7 +229,6 @@ class db } } while($ok == false); - $aArgs = func_get_args(); $sQuery = call_user_func_array(array(&$this, '_build_query_string'), $aArgs); $this->_iQueryId = mysqli_query($this->_iConnId, $sQuery); @@ -283,9 +284,11 @@ class db * @return array result row or NULL if none found */ public function queryOneRecord($sQuery = '') { - if(!preg_match('/limit \d+\s*,\s*\d+$/i', $sQuery)) $sQuery .= ' LIMIT 0,1'; - + $aArgs = func_get_args(); + + if(!preg_match('/limit \d+\s*,\s*\d+$/i', $sQuery)) $sQuery .= ' LIMIT 0,1'; + $oResult = call_user_func_array(array(&$this, 'query'), $aArgs); if(!$oResult) return null; @@ -956,7 +959,7 @@ class fakedb_result { if(!is_array($this->aLimitedData)) return $aItem; - if(list($vKey, $aItem) = each($this->aLimitedData)) { + foreach($this->aLimitedData as $vKey => $aItem) { if(!$aItem) $aItem = null; } return $aItem; diff --git a/interface/lib/classes/cmstree.inc.php b/interface/lib/classes/cmstree.inc.php deleted file mode 100644 index ead780ebf26c65fd01d97a10a5f0f640ca54e9be..0000000000000000000000000000000000000000 --- a/interface/lib/classes/cmstree.inc.php +++ /dev/null @@ -1,117 +0,0 @@ -<? - -/* -Copyright (c) 2007, Till Brehm, projektfarm Gmbh -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of ISPConfig nor the names of its contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -class nodetree { - public $childs; - public $btext; - public $id; -} - -class cmstree -{ - //TODO is this used ?? - pedro - //var $_table; - - // $vars enth�lt: - // - parent :id des Elternelementes - // - type :n = node, i = item - // - doctype_id :id des Dokumententyps, wenn nicht im content Feld - // - title :Titel des Eintrages - // - status :1 = ok, d = delete - // - icon :icon im node-tree, optional - // - modul :modul des Eintrages, noch nicht verwendet - // - doc_id :id des zugeh�rigen Dokumentes - - public function node_list() - { - global $app; - - $nodes = $app->db->queryAllRecords('SELECT * FROM media_cat order by sort, name'); - - $optionlist = array(); - $my0 = new nodetree(); - - foreach($nodes as $row) { - - $id = 'my'.$row['media_cat_id']; - $btext = $row['name']; - $ordner = 'my'.$row['parent']; - if(!is_object($$id)) $$id = new nodetree(); - $$id->btext = $btext; - $$id->id = $row['media_cat_id']; - - if(is_object($$ordner)) { - $$ordner->childs[] = &$$id; - } else { - $$ordner = new nodetree(); - $$ordner->childs[] = &$$id; - } - } - - $this->ptree($my0, 0, $optionlist); - return is_array($nodes) ? $optionlist : false; - } - - private function ptree($myobj, $tiefe, &$optionlist){ - global $_SESSION; - $tiefe += 1; - $id = $myobj->id; - - if(is_array($myobj->childs) and ($_SESSION['s']['cat_open'][$id] == 1 or $tiefe <= 1)) { - foreach($myobj->childs as $val) { - // kategorie => str_repeat('- ',$tiefe) . $val->btext, - - // Ergebnisse Formatieren - /* - if($tiefe == 0) { - $kategorie = "<div class='mnuLevel".$tiefe."'><a href='index.php?pg=liste&kat=".$val->id."' class='navKategorien'>".$val->btext."</a></div>"; - } elseif ($tiefe == 1) { - $kategorie = "<div class='mnuLevel".$tiefe."'><img src='images/listenpunkt.gif'> <a href='index.php?pg=liste&kat=".$val->id."' class='navKategorien'>".$val->btext."</a></div>"; - } else { - $kategorie = "<div class='mnuLevel".$tiefe."'> <a href='index.php?pg=liste&kat=".$val->id."' class='navKategorien'>".str_repeat('- ',$tiefe - 1) . $val->btext."</a></div>"; - } - */ - $val_id = $val->id; - if($_SESSION['s']['cat_open'][$val_id] == 1) { - $kategorie = "<div class='mnuLevel".$tiefe."'> <a href='treenavi.php?kat=".$val->id."' class='navtext' onclick=\"parent.content.location='media_list.php?search_media_cat_id=".$val->id."'\" style=\"text-decoration: none;\"><img src='../themes/default/icons/folder.png' border='0'> ".$val->btext."</a></div>"; - } else { - $kategorie = "<div class='mnuLevel".$tiefe."'> <a href='treenavi.php?kat=".$val->id."' class='navtext' onclick=\"parent.content.location='media_list.php?search_media_cat_id=".$val->id."'\" style=\"text-decoration: none;\"><img src='../themes/default/icons/folder_closed.png' border='0'> ".$val->btext."</a></div>"; - } - - $optionlist[] = array( media_cat => $kategorie, - media_cat_id => $val->id, - depth => $tiefe); - $this->ptree($val, $tiefe, $optionlist); - } - } - } - -} -?> diff --git a/interface/lib/classes/db_mysql.inc.php b/interface/lib/classes/db_mysql.inc.php index 9c7269e568624cb7ae2f696929130ad1817b9e63..5348e417084fe1e4c63002d52579fd9ffc592338 100644 --- a/interface/lib/classes/db_mysql.inc.php +++ b/interface/lib/classes/db_mysql.inc.php @@ -258,6 +258,8 @@ class db private function _query($sQuery = '') { global $app; + + $aArgs = func_get_args(); if ($sQuery == '') { $this->_sqlerror('Keine Anfrage angegeben / No query given'); @@ -297,7 +299,6 @@ class db } } while($ok == false); - $aArgs = func_get_args(); $sQuery = call_user_func_array(array(&$this, '_build_query_string'), $aArgs); $this->securityScan($sQuery); $this->_iQueryId = mysqli_query($this->_iConnId, $sQuery); @@ -353,9 +354,11 @@ class db * @return array result row or NULL if none found */ public function queryOneRecord($sQuery = '') { + + $aArgs = func_get_args(); + if(!preg_match('/limit \d+\s*(,\s*\d+)?$/i', $sQuery)) $sQuery .= ' LIMIT 0,1'; - $aArgs = func_get_args(); $oResult = call_user_func_array(array(&$this, 'query'), $aArgs); if(!$oResult) return null; @@ -1300,7 +1303,7 @@ class fakedb_result { if(!is_array($this->aLimitedData)) return $aItem; - if(list($vKey, $aItem) = each($this->aLimitedData)) { + foreach($this->aLimitedData as $vKey => $aItem) { if(!$aItem) $aItem = null; } return $aItem; diff --git a/interface/lib/classes/simplepie.inc.php b/interface/lib/classes/simplepie.inc.php index 626e801e426242351a7e29034808486800332ac6..a2b80ed25b71755c81e56722f453d85d95207630 100644 --- a/interface/lib/classes/simplepie.inc.php +++ b/interface/lib/classes/simplepie.inc.php @@ -735,7 +735,7 @@ class simplepie * @param string $cache_location This is where you want the cache to be stored. * @param int $cache_duration This is the number of seconds that you want to store the cache file for. */ - function SimplePie($feed_url = null, $cache_location = null, $cache_duration = null) + function __construct($feed_url = null, $cache_location = null, $cache_duration = null) { // Other objects, instances created here so we can set options on them $this->sanitize = new SimplePie_Sanitize; @@ -3165,7 +3165,7 @@ class SimplePie_Item var $feed; var $data = array(); - function SimplePie_Item($feed, $data) + function __construct($feed, $data) { $this->feed = $feed; $this->data = $data; @@ -5789,7 +5789,7 @@ class SimplePie_Source var $item; var $data = array(); - function SimplePie_Source($item, $data) + function __construct($item, $data) { $this->item = $item; $this->data = $data; @@ -6344,7 +6344,7 @@ class SimplePie_Author var $email; // Constructor, used to input the data - function SimplePie_Author($name = null, $link = null, $email = null) + function __construct($name = null, $link = null, $email = null) { $this->name = $name; $this->link = $link; @@ -6402,7 +6402,7 @@ class SimplePie_Category var $label; // Constructor, used to input the data - function SimplePie_Category($term = null, $scheme = null, $label = null) + function __construct($term = null, $scheme = null, $label = null) { $this->term = $term; $this->scheme = $scheme; @@ -6484,7 +6484,7 @@ class SimplePie_Enclosure var $width; // Constructor, used to input the data - function SimplePie_Enclosure($link = null, $type = null, $length = null, $javascript = null, $bitrate = null, $captions = null, $categories = null, $channels = null, $copyright = null, $credits = null, $description = null, $duration = null, $expression = null, $framerate = null, $hashes = null, $height = null, $keywords = null, $lang = null, $medium = null, $player = null, $ratings = null, $restrictions = null, $samplingrate = null, $thumbnails = null, $title = null, $width = null) + function __construct($link = null, $type = null, $length = null, $javascript = null, $bitrate = null, $captions = null, $categories = null, $channels = null, $copyright = null, $credits = null, $description = null, $duration = null, $expression = null, $framerate = null, $hashes = null, $height = null, $keywords = null, $lang = null, $medium = null, $player = null, $ratings = null, $restrictions = null, $samplingrate = null, $thumbnails = null, $title = null, $width = null) { $this->bitrate = $bitrate; $this->captions = $captions; @@ -7419,7 +7419,7 @@ class SimplePie_Caption var $text; // Constructor, used to input the data - function SimplePie_Caption($type = null, $lang = null, $startTime = null, $endTime = null, $text = null) + function __construct($type = null, $lang = null, $startTime = null, $endTime = null, $text = null) { $this->type = $type; $this->lang = $lang; @@ -7503,7 +7503,7 @@ class SimplePie_Credit var $name; // Constructor, used to input the data - function SimplePie_Credit($role = null, $scheme = null, $name = null) + function __construct($role = null, $scheme = null, $name = null) { $this->role = $role; $this->scheme = $scheme; @@ -7560,7 +7560,7 @@ class SimplePie_Copyright var $label; // Constructor, used to input the data - function SimplePie_Copyright($url = null, $label = null) + function __construct($url = null, $label = null) { $this->url = $url; $this->label = $label; @@ -7604,7 +7604,7 @@ class SimplePie_Rating var $value; // Constructor, used to input the data - function SimplePie_Rating($scheme = null, $value = null) + function __construct($scheme = null, $value = null) { $this->scheme = $scheme; $this->value = $value; @@ -7649,7 +7649,7 @@ class SimplePie_Restriction var $value; // Constructor, used to input the data - function SimplePie_Restriction($relationship = null, $type = null, $value = null) + function __construct($relationship = null, $type = null, $value = null) { $this->relationship = $relationship; $this->type = $type; @@ -7715,7 +7715,7 @@ class SimplePie_File var $error; var $method = SIMPLEPIE_FILE_SOURCE_NONE; - function SimplePie_File($url, $timeout = 10, $redirects = 5, $headers = null, $useragent = null, $force_fsockopen = false) + function __construct($url, $timeout = 10, $redirects = 5, $headers = null, $useragent = null, $force_fsockopen = false) { if (class_exists('idna_convert')) { @@ -8036,7 +8036,7 @@ class SimplePie_HTTP_Parser * @access public * @param string $data Input data */ - function SimplePie_HTTP_Parser($data) + function __construct($data) { $this->data = $data; $this->data_length = strlen($this->data); @@ -8512,7 +8512,7 @@ class SimplePie_gzdecode * * @access public */ - function SimplePie_gzdecode($data) + function __construct($data) { $this->compressed_data = $data; $this->compressed_size = strlen($data); @@ -8705,7 +8705,7 @@ class SimplePie_Cache * * @access private */ - function SimplePie_Cache() + function __construct() { trigger_error('Please call SimplePie_Cache::create() instead of the constructor', E_USER_ERROR); } @@ -8743,7 +8743,7 @@ class SimplePie_Cache_File var $extension; var $name; - function SimplePie_Cache_File($location, $filename, $extension) + function __construct($location, $filename, $extension) { $this->location = $location; $this->filename = $filename; @@ -8905,7 +8905,7 @@ class SimplePie_Cache_MySQL extends SimplePie_Cache_DB var $options; var $id; - function SimplePie_Cache_MySQL($mysql_location, $name, $extension) + function __construct($mysql_location, $name, $extension) { $host = $mysql_location->get_host(); if (SimplePie_Misc::stripos($host, 'unix(') === 0 && substr($host, -1) === ')') @@ -11532,7 +11532,7 @@ class SimplePie_Decode_HTML_Entities * @access public * @param string $data Input data */ - function SimplePie_Decode_HTML_Entities($data) + function __construct($data) { $this->data = $data; } @@ -11795,7 +11795,7 @@ class SimplePie_IRI * @param string $iri * @return SimplePie_IRI */ - function SimplePie_IRI($iri) + function __construct($iri) { $iri = (string) $iri; if ($iri !== '') @@ -13184,7 +13184,7 @@ class SimplePie_Parse_Date * * @access private */ - function SimplePie_Parse_Date() + function __construct() { $this->day_pcre = '(' . implode(array_keys($this->day), '|') . ')'; $this->month_pcre = '(' . implode(array_keys($this->month), '|') . ')'; @@ -13658,7 +13658,7 @@ class SimplePie_Content_Type_Sniffer * @access public * @param SimplePie_Content_Type_Sniffer $file Input file */ - function SimplePie_Content_Type_Sniffer($file) + function __construct($file) { $this->file = $file; } @@ -13990,7 +13990,7 @@ class SimplePie_XML_Declaration_Parser * @access public * @param string $data Input data */ - function SimplePie_XML_Declaration_Parser($data) + function __construct($data) { $this->data = $data; $this->data_length = strlen($this->data); @@ -14259,7 +14259,7 @@ class SimplePie_Locator var $max_checked_feeds = 10; var $content_type_sniffer_class = 'SimplePie_Content_Type_Sniffer'; - function SimplePie_Locator(&$file, $timeout = 10, $useragent = null, $file_class = 'SimplePie_File', $max_checked_feeds = 10, $content_type_sniffer_class = 'SimplePie_Content_Type_Sniffer') + function __construct(&$file, $timeout = 10, $useragent = null, $file_class = 'SimplePie_File', $max_checked_feeds = 10, $content_type_sniffer_class = 'SimplePie_Content_Type_Sniffer') { $this->file =& $file; $this->file_class = $file_class; diff --git a/interface/lib/classes/system.inc.php b/interface/lib/classes/system.inc.php index b6d3479694193287a1e8c878e5af11225e5b7a3d..89507ea68cadba60599d469c6463fd521a706855 100644 --- a/interface/lib/classes/system.inc.php +++ b/interface/lib/classes/system.inc.php @@ -65,12 +65,13 @@ class system { public function exec_safe($cmd) { $arg_count = func_num_args(); + $args = func_get_args(); + if($arg_count != substr_count($cmd, '?') + 1) { trigger_error('Placeholder count not matching argument list.', E_USER_WARNING); return false; } if($arg_count > 1) { - $args = func_get_args(); array_shift($args); $pos = 0; diff --git a/interface/web/mailuser/mail_user_autoresponder_edit.php b/interface/web/mailuser/mail_user_autoresponder_edit.php index d93151bf24094f72829e2da89dcfb5321b6ee413..827a585e509edfb5fb261d810d4dd6501f290521 100644 --- a/interface/web/mailuser/mail_user_autoresponder_edit.php +++ b/interface/web/mailuser/mail_user_autoresponder_edit.php @@ -66,6 +66,12 @@ class page_action extends tform_actions { if (!isset($_POST['autoresponder']) && array_key_exists('autoresponder_start_date', $_POST)) { $this->dataRecord['autoresponder_start_date'] = array_map(create_function('$item', 'return 0;'), $this->dataRecord['autoresponder_start_date']); $this->dataRecord['autoresponder_end_date'] = array_map(create_function('$item', 'return 0;'), $this->dataRecord['autoresponder_end_date']); + + /* To be used when we go to PHP 7.x as min PHP version + $this->dataRecord['autoresponder_start_date'] = array_map( function ('$item') { 'return 0;' }, $this->dataRecord['autoresponder_start_date']); + $this->dataRecord['autoresponder_end_date'] = array_map( function ('$item') { 'return 0;' }, $this->dataRecord['autoresponder_end_date']); + */ + } parent::onSubmit(); diff --git a/interface/web/remote/monitor.php b/interface/web/remote/monitor.php index 132bcf29a5bc01a297eaf488565cd4db340fd810..914a09382ea4fa65d1442912d8fb42436e67ef09 100644 --- a/interface/web/remote/monitor.php +++ b/interface/web/remote/monitor.php @@ -59,73 +59,6 @@ if($token == '' or $secret == '' or $token != $secret) { } } $out['type'] = $type; - -function __json_encode($data) { - if( is_array($data) || is_object($data) ) { - $islist = is_array($data) && ( empty($data) || array_keys($data) === range(0, count($data)-1) ); - - if( $islist ) { - $json = '[' . implode(',', array_map('__json_encode', $data) ) . ']'; - } else { - $items = array(); - foreach( $data as $key => $value ) { - $items[] = __json_encode("$key") . ':' . __json_encode($value); - } - $json = '{' . implode(',', $items) . '}'; - } - } elseif( is_string($data) ) { - // Escape non-printable or Non-ASCII characters. - // I also put the \\ character first, as suggested in comments on the 'addcslashes' page. - $string = '"' . addcslashes($data, "\\\"\n\r\t/" . chr(8) . chr(12)) . '"'; - $json = ''; - $len = strlen($string); - // Convert UTF-8 to Hexadecimal Codepoints. - for( $i = 0; $i < $len; $i++ ) { - - $char = $string[$i]; - $c1 = ord($char); - - // Single byte; - if( $c1 <128 ) { - $json .= ($c1 > 31) ? $char : sprintf("\\u%04x", $c1); - continue; - } - - // Double byte - $c2 = ord($string[++$i]); - if ( ($c1 & 32) === 0 ) { - $json .= sprintf("\\u%04x", ($c1 - 192) * 64 + $c2 - 128); - continue; - } - - // Triple - $c3 = ord($string[++$i]); - if( ($c1 & 16) === 0 ) { - $json .= sprintf("\\u%04x", (($c1 - 224) <<12) + (($c2 - 128) << 6) + ($c3 - 128)); - continue; - } - - // Quadruple - $c4 = ord($string[++$i]); - if( ($c1 & 8 ) === 0 ) { - $u = (($c1 & 15) << 2) + (($c2>>4) & 3) - 1; - - $w1 = (54<<10) + ($u<<6) + (($c2 & 15) << 2) + (($c3>>4) & 3); - $w2 = (55<<10) + (($c3 & 15)<<6) + ($c4-128); - $json .= sprintf("\\u%04x\\u%04x", $w1, $w2); - } - } - } else { - // int, floats, bools, null - $json = strtolower(var_export( $data, true )); - } - return $json; -} - -if(function_exists('json_encode')) { // PHP >= 5.2 - echo json_encode($out); -} else { // PHP < 5.2 - echo __json_encode($out); -} +echo json_encode($out); exit; ?> diff --git a/server/lib/classes/db_mysql.inc.php b/server/lib/classes/db_mysql.inc.php index 4bbc84e3f9b1bd9be45e6795f0e484e2e6d1700e..2bccf1ecb721ada8a6d34faca81d23177d149186 100644 --- a/server/lib/classes/db_mysql.inc.php +++ b/server/lib/classes/db_mysql.inc.php @@ -258,6 +258,8 @@ class db private function _query($sQuery = '') { global $app; + + $aArgs = func_get_args(); if ($sQuery == '') { $this->_sqlerror('Keine Anfrage angegeben / No query given'); @@ -297,7 +299,6 @@ class db } } while($ok == false); - $aArgs = func_get_args(); $sQuery = call_user_func_array(array(&$this, '_build_query_string'), $aArgs); $this->securityScan($sQuery); $this->_iQueryId = mysqli_query($this->_iConnId, $sQuery); @@ -353,9 +354,10 @@ class db * @return array result row or NULL if none found */ public function queryOneRecord($sQuery = '') { - if(!preg_match('/limit \d+\s*(,\s*\d+)?$/i', $sQuery)) $sQuery .= ' LIMIT 0,1'; $aArgs = func_get_args(); + if(!preg_match('/limit \d+\s*(,\s*\d+)?$/i', $sQuery)) $sQuery .= ' LIMIT 0,1'; + $oResult = call_user_func_array(array(&$this, 'query'), $aArgs); if(!$oResult) return null; @@ -1300,7 +1302,7 @@ class fakedb_result { if(!is_array($this->aLimitedData)) return $aItem; - if(list($vKey, $aItem) = each($this->aLimitedData)) { + foreach($this->aLimitedData as $vKey => $aItem) { if(!$aItem) $aItem = null; } return $aItem; diff --git a/server/lib/classes/file.inc.php b/server/lib/classes/file.inc.php index eadb38b789f0cfd9f80d6fd951e53be403616821..28757d0dd50b4e30baab69e29cf14d22dfb4e577 100644 --- a/server/lib/classes/file.inc.php +++ b/server/lib/classes/file.inc.php @@ -158,26 +158,6 @@ class file{ return $ret_val; } - function edit_dist($var, $val){ - global $$var; - $files = array('/root/ispconfig/dist.inc.php'); - foreach($files as $file){ - if(is_file($file)){ - $file_content = $this->unix_nl($this->rf($file)); - $lines = explode("\n", $file_content); - for($i=0;$i<sizeof($lines);$i++){ - $parts = explode('=', $lines[$i]); - if($parts[0] == $var || $parts[0] == '$'.$var.' '){ - $parts[1] = str_replace($$var, $val, $parts[1]); - } - $lines[$i] = implode('=', $parts); - } - $file_content = implode("\n", $lines); - $this->wf($file, $file_content); - } - } - } - function getDirectoryListing($dirname, $sortorder = 'a', $show_subdirs = 0, $show_subdirfiles = 0, $exts = '', $ext_save = 1){ // This function will return an array with filenames based on the criteria you can set in the variables // @sortorder : a for ascending (the standard) or d for descending (you can use the "r" for reverse as well, works the same) diff --git a/server/lib/classes/system.inc.php b/server/lib/classes/system.inc.php index 551e4e485315948f4bf1da53cabb62022dc79808..078c225c107b99f463f58a79dce0ab243b35ef47 100644 --- a/server/lib/classes/system.inc.php +++ b/server/lib/classes/system.inc.php @@ -2121,13 +2121,13 @@ class system{ public function exec_safe($cmd) { global $app; + $args = func_get_args(); $arg_count = func_num_args(); if($arg_count != substr_count($cmd, '?') + 1) { trigger_error('Placeholder count not matching argument list.', E_USER_WARNING); return false; } if($arg_count > 1) { - $args = func_get_args(); array_shift($args); $pos = 0;