Last active
March 29, 2016 21:26
-
-
Save donquixote/0140b0c009370f6323c023a7e6dc3e6a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function file_scan_directory($dir, $mask, $options = array(), $depth = 0) { | |
[..] | |
if ($options['nomask'] === NULL | |
&& $options['recurse'] | |
// Detect patterns like '/\.tpl\.php$/' or '/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*\.module$/'. | |
// The first part is | |
&& preg_match('@/(.*?[^\\\\]|)((?:[_a-zA-Z0-9]|\\\\\\.)*)\$/@', $mask, $m) | |
) { | |
// Use a faster algorithm for this special case. | |
list(, $basename_pattern, $extension_pattern) = $m; | |
$basename_pattern = ('' !== $basename_pattern) | |
? '/' . $basename_pattern . '$/' | |
: NULL; | |
$extension = str_replace('\\.' , '.', $extension_pattern); | |
return _drupal_file_scan_directory_fast($dir, $basename_pattern, $extension, $options); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment