aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2013-05-15 14:10:51 +0200
committerAndreas Fischer <bantu@phpbb.com>2013-05-15 14:10:51 +0200
commit44c4c3ed988b72724b3bf74d1a65166cb68eb3d5 (patch)
treee20bb165227db759d426c74a6adfb3d44193e16e
parentc9b2b7cc3286edaf852343e547bb361e33b1b821 (diff)
parent5c23ed57fe88c9bae26c4ecfb27029c6799ae1c9 (diff)
downloadforums-44c4c3ed988b72724b3bf74d1a65166cb68eb3d5.tar
forums-44c4c3ed988b72724b3bf74d1a65166cb68eb3d5.tar.gz
forums-44c4c3ed988b72724b3bf74d1a65166cb68eb3d5.tar.bz2
forums-44c4c3ed988b72724b3bf74d1a65166cb68eb3d5.tar.xz
forums-44c4c3ed988b72724b3bf74d1a65166cb68eb3d5.zip
Merge branch 'develop-olympus' into develop
* develop-olympus: [ticket/11546] Fix is_absolute() throws E_NOTICE for empty string
-rw-r--r--phpBB/includes/functions.php2
-rw-r--r--tests/functions/is_absolute_test.php1
2 files changed, 2 insertions, 1 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 41a3de31f2..0217aedb54 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -846,7 +846,7 @@ function phpbb_is_writable($file)
*/
function phpbb_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 64a7a81b4a..ada4d7b4de 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),