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,7 +1,7 @@
<?php
function config_read($fullpath) {
if ($fullpath{0}!='/')
if ($fullpath [0] != '/')
trigger_error('config_read: syntax error. Path must begin with a /');
$last_slash = strrpos($fullpath, '/');
$option = substr($fullpath, $last_slash + 1);
@ -15,13 +15,11 @@
$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))
$conffile = CONFIG_DEFAULT;
@ -30,10 +28,8 @@
// 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 ;)
@ -45,7 +41,9 @@
$conf_arr = $fp_config;
}
$arr = array('fp_config' => $conf_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);