diff --git a/core/includes/file.inc b/core/includes/file.inc index fd77536..5d4a2bc 100644 --- a/core/includes/file.inc +++ b/core/includes/file.inc @@ -1441,7 +1441,7 @@ function file_scan_directory($dir, $mask, $options = array(), $depth = 0) { // Normalize $dir only once. if ($depth == 0) { $dir = file_stream_wrapper_uri_normalize($dir); - $dir_has_slash = ($dir[drupal_strlen($dir) - 1] === '/'); + $dir_has_slash = (substr($dir, -1) === '/'); } $options['key'] = in_array($options['key'], array('uri', 'filename', 'name')) ? $options['key'] : 'uri';