replace {} string access with equivalent substr() to avoid E_STRICT warnings in PHP 5.1

This commit is contained in:
boots
2005-11-23 20:36:05 +00:00
parent 3741b9d6c5
commit fdb25e363f
8 changed files with 31 additions and 29 deletions

View File

@@ -285,9 +285,9 @@ class Config_File {
$line = $lines[$i];
if (empty($line)) continue;
if ( $line{0} == '[' && preg_match('!^\[(.*?)\]!', $line, $match) ) {
if ( substr($line, 0, 1) == '[' && preg_match('!^\[(.*?)\]!', $line, $match) ) {
/* section found */
if ($match[1]{0} == '.') {
if (substr($match[1], 0, 1) == '.') {
/* hidden section */
if ($this->read_hidden) {
$section_name = substr($match[1], 1);
@@ -347,7 +347,7 @@ class Config_File {
*/
function _set_config_var(&$container, $var_name, $var_value, $booleanize)
{
if ($var_name{0} == '.') {
if (substr($var_name, 0, 1) == '.') {
if (!$this->read_hidden)
return;
else