From 038a0931f63c4ccf4b9f1de564cd3c6b6b43c58a Mon Sep 17 00:00:00 2001 From: Andreas Gohr <andi@splitbrain.org> Date: Sun, 24 Jun 2007 19:49:03 +0200 Subject: [PATCH] workaround for PHP bug in config manager FS#1152 Workaround for PHP bug 41773: http://bugs.php.net/bug.php?idA773 darcs-hash:20070624174903-7ad00-ae406540aca27e20f8fbd2f7c454c079975ebe22.gz --- lib/plugins/config/settings/config.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/plugins/config/settings/config.class.php b/lib/plugins/config/settings/config.class.php index 4d694de1f..1a116cb34 100644 --- a/lib/plugins/config/settings/config.class.php +++ b/lib/plugins/config/settings/config.class.php @@ -133,7 +133,11 @@ if (!class_exists('configuration')) { if ($this->_format == 'php') { - $contents = @php_strip_whitespace($file); + if(@file_exists($file)){ + $contents = @php_strip_whitespace($file); + }else{ + $contents = ''; + } $pattern = '/\$'.$this->_name.'\[[\'"]([^=]+)[\'"]\] ?= ?(.*?);(?=[^;]*(?:\$'.$this->_name.'|@include|$))/s'; $matches=array(); preg_match_all($pattern,$contents,$matches,PREG_SET_ORDER); -- GitLab