mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-06 16:56:44 +02:00
Merge remote-tracking branch 'nickvergessen/ticket/11546' into develop-olympus
* nickvergessen/ticket/11546: [ticket/11546] Fix is_absolute() throws E_NOTICE for empty string
This commit is contained in:
@@ -1005,7 +1005,7 @@ if (!function_exists('stripos'))
|
|||||||
*/
|
*/
|
||||||
function is_absolute($path)
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -14,6 +14,7 @@ class phpbb_functions_is_absolute_test extends phpbb_test_case
|
|||||||
static public function is_absolute_data()
|
static public function is_absolute_data()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
|
array('', false),
|
||||||
array('/etc/phpbb', true),
|
array('/etc/phpbb', true),
|
||||||
array('etc/phpbb', false),
|
array('etc/phpbb', false),
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user