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:
azett 2019-11-18 16:56:57 +01:00
parent 76dbaa342b
commit b6f32d1f4f
3 changed files with 99 additions and 101 deletions

View File

@ -1,52 +1,50 @@
<?php
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);
$path = substr($fullpath, 1, $last_slash);
$file = str_replace('/', '.', $path) . 'conf.php';
$f = CONFIG_DIR . $file;
if (file_exists($f)) {
include($f);
}
$arr = explode('/', $fullpath);
/* todo finire */
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);
$path = substr($fullpath, 1, $last_slash);
$file = str_replace('/', '.', $path) . 'conf.php';
$f = CONFIG_DIR . $file;
if (file_exists($f)) {
include ($f);
}
// a cosmetic wrapper around an include :D
// plus, loads the defaults if CONFIG_FILE is not found
function config_load($conffile=CONFIG_FILE) {
$arr = explode('/', $fullpath);
if ( !file_exists($conffile) && ($conffile==CONFIG_FILE) )
$conffile = CONFIG_DEFAULT;
/* todo finire */
}
include $conffile;
// 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;
// todo CHANGE
//$fp_config['general'] = array_change_key_case($blog_confi);
return $fp_config;
include $conffile;
// todo CHANGE
// $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) {
global $fp_config;
$conf_arr = $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) {
global $fp_config;
$conf_arr=$fp_config;
}
$arr = array('fp_config' => $conf_arr);
return system_save($conffile, $arr);
}
$arr = array(
'fp_config' => $conf_arr
);
return system_save($conffile, $arr);
}
?>

View File

@ -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)

View File

@ -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('---', '&#8212;', $curl);
$curl = str_replace(' -- ', ' &#8212; ', $curl);
$curl = str_replace('--', '&#8211;', $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};)/', '&#038;$1', $curl);