1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-04-30 12:48:21 +02:00

[ticket/11546] Fix is_absolute() throws E_NOTICE for empty string

PHPBB3-11546
This commit is contained in:
Joas Schilling 2013-05-15 13:55:35 +02:00
parent f2bc62ba75
commit 06edf15ac3
2 changed files with 2 additions and 1 deletions

View File

@ -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;
}
/**

View File

@ -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),