diff options
| author | Andreas Fischer <bantu@phpbb.com> | 2013-05-15 14:10:40 +0200 |
|---|---|---|
| committer | Andreas Fischer <bantu@phpbb.com> | 2013-05-15 14:10:40 +0200 |
| commit | 5c23ed57fe88c9bae26c4ecfb27029c6799ae1c9 (patch) | |
| tree | 71eb2c073515435b441e41097f8b5288f1ea63cb | |
| parent | f2bc62ba75648d9a56d8fa5f215e4bffd299e77a (diff) | |
| parent | 06edf15ac3e63350b7973b04f07578de1c4565d0 (diff) | |
| download | forums-5c23ed57fe88c9bae26c4ecfb27029c6799ae1c9.tar forums-5c23ed57fe88c9bae26c4ecfb27029c6799ae1c9.tar.gz forums-5c23ed57fe88c9bae26c4ecfb27029c6799ae1c9.tar.bz2 forums-5c23ed57fe88c9bae26c4ecfb27029c6799ae1c9.tar.xz forums-5c23ed57fe88c9bae26c4ecfb27029c6799ae1c9.zip | |
Merge remote-tracking branch 'nickvergessen/ticket/11546' into develop-olympus
* nickvergessen/ticket/11546:
[ticket/11546] Fix is_absolute() throws E_NOTICE for empty string
| -rw-r--r-- | phpBB/includes/functions.php | 2 | ||||
| -rw-r--r-- | tests/functions/is_absolute_test.php | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index cf676a3351..4b144a20a1 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1005,7 +1005,7 @@ if (!function_exists('stripos')) */ function is_absolute($path) { - return ($path[0] == '/' || (DIRECTORY_SEPARATOR == '\\' && preg_match('#^[a-z]:[/\\\]#i', $path))) ? true : false; + return (isset($path[0]) && $path[0] == '/' || (DIRECTORY_SEPARATOR == '\\' && preg_match('#^[a-z]:[/\\\]#i', $path))) ? true : false; } /** diff --git a/tests/functions/is_absolute_test.php b/tests/functions/is_absolute_test.php index 26425d2a36..5d70b6c2a3 100644 --- a/tests/functions/is_absolute_test.php +++ b/tests/functions/is_absolute_test.php @@ -14,6 +14,7 @@ class phpbb_functions_is_absolute_test extends phpbb_test_case static public function is_absolute_data() { return array( + array('', false), array('/etc/phpbb', true), array('etc/phpbb', false), |
