Curly brace syntax for accessing array elements and string offsets will be deprecated as of PHP 7.4 - changed to square brackets. See also https://wiki.php.net/rfc/deprecate_curly_braces_array_access
This commit is contained in:
parent
76dbaa342b
commit
b6f32d1f4f
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
function config_read($fullpath) {
|
||||
if ($fullpath{0}!='/')
|
||||
function config_read($fullpath) {
|
||||
if ($fullpath [0] != '/')
|
||||
trigger_error('config_read: syntax error. Path must begin with a /');
|
||||
$last_slash = strrpos($fullpath, '/');
|
||||
$option = substr($fullpath, $last_slash + 1);
|
||||
@ -9,44 +9,42 @@
|
||||
$file = str_replace('/', '.', $path) . 'conf.php';
|
||||
$f = CONFIG_DIR . $file;
|
||||
if (file_exists($f)) {
|
||||
include($f);
|
||||
include ($f);
|
||||
}
|
||||
|
||||
$arr = explode('/', $fullpath);
|
||||
|
||||
/* todo finire */
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// a cosmetic wrapper around an include :D
|
||||
// plus, loads the defaults if CONFIG_FILE is not found
|
||||
function config_load($conffile=CONFIG_FILE) {
|
||||
|
||||
if ( !file_exists($conffile) && ($conffile==CONFIG_FILE) )
|
||||
// a cosmetic wrapper around an include :D
|
||||
// plus, loads the defaults if CONFIG_FILE is not found
|
||||
function config_load($conffile = CONFIG_FILE) {
|
||||
if (!file_exists($conffile) && ($conffile == CONFIG_FILE))
|
||||
$conffile = CONFIG_DEFAULT;
|
||||
|
||||
include $conffile;
|
||||
|
||||
// todo CHANGE
|
||||
//$fp_config['general'] = array_change_key_case($blog_confi);
|
||||
// $fp_config['general'] = array_change_key_case($blog_confi);
|
||||
return $fp_config;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// $conf_arr can have a variable number of args
|
||||
// they are the same of system_save(), as this is in fact
|
||||
// a wrapper to that ;)
|
||||
// so:
|
||||
// $conf_arr[ 'myvariable' ] = $myvariable;
|
||||
function config_save($conf_arr=null, $conffile=CONFIG_FILE) {
|
||||
if ($conf_arr==null) {
|
||||
// $conf_arr can have a variable number of args
|
||||
// they are the same of system_save(), as this is in fact
|
||||
// a wrapper to that ;)
|
||||
// so:
|
||||
// $conf_arr[ 'myvariable' ] = $myvariable;
|
||||
function config_save($conf_arr = null, $conffile = CONFIG_FILE) {
|
||||
if ($conf_arr == null) {
|
||||
global $fp_config;
|
||||
$conf_arr=$fp_config;
|
||||
$conf_arr = $fp_config;
|
||||
}
|
||||
|
||||
$arr = array('fp_config' => $conf_arr);
|
||||
$arr = array(
|
||||
'fp_config' => $conf_arr
|
||||
);
|
||||
return system_save($conffile, $arr);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -276,7 +276,7 @@ function utils_microtime() {
|
||||
function utils_countdashes($string, &$rest) {
|
||||
trim($string);
|
||||
$i = 0;
|
||||
while ($string {$i} == '-') {
|
||||
while ($string [$i] == '-') {
|
||||
$i++;
|
||||
}
|
||||
if ($i)
|
||||
|
@ -9,7 +9,7 @@ function wptexturize($text) {
|
||||
for($i = 0; $i < $stop; $i++) {
|
||||
$curl = $textarr [$i];
|
||||
|
||||
if (isset($curl {0}) && '<' != $curl {0} && $skip == 0) { // If it's not a tag
|
||||
if (isset($curl [0]) && '<' != $curl [0] && $skip == 0) { // If it's not a tag
|
||||
$curl = str_replace('---', '—', $curl);
|
||||
$curl = str_replace(' -- ', ' — ', $curl);
|
||||
$curl = str_replace('--', '–', $curl);
|
||||
@ -70,7 +70,7 @@ function wptexturize($text) {
|
||||
// strstr is fast
|
||||
$skip++;
|
||||
} else {
|
||||
if (isset($curl {0}) && $curl {0} == "<" && $skip > 0)
|
||||
if (isset($curl [0]) && $curl [0] == "<" && $skip > 0)
|
||||
$skip++;
|
||||
}
|
||||
$curl = preg_replace('/&([^#])(?![a-z12]{1,8};)/', '&$1', $curl);
|
||||
|
Loading…
x
Reference in New Issue
Block a user