diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-03-26 03:09:23 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-03-26 03:09:23 +0000 |
commit | a28deb86741d35a0ab6365ed1455b8e50aa31c81 (patch) | |
tree | 9be62fd6ad23b2336a38897c4c0a3e6a789109c3 | |
parent | 11bfacba086cb014a40eb11f70dffaa9e422409b (diff) |
Use pathinfo() instead of substr/strchr/etc to get the file extension.
-rw-r--r-- | core/libraries/L10n_Scanner.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/libraries/L10n_Scanner.php b/core/libraries/L10n_Scanner.php index 9c1138cd..6352a319 100644 --- a/core/libraries/L10n_Scanner.php +++ b/core/libraries/L10n_Scanner.php @@ -57,7 +57,7 @@ class L10n_Scanner_Core { new L10n_Scanner_Directory_Filter_Iterator( new RecursiveDirectoryIterator(DOCROOT)))); foreach ($dir as $file) { - if (substr(strrchr($file->getFilename(), '.'), 1) == "php") { + if (pathinfo($file->getFilename(), PATHINFO_EXTENSION) == "php") { $this->_scan_php_file($file, $this); } else { $this->_scan_info_file($file, $this); @@ -160,7 +160,7 @@ class L10n_Scanner_Core { } } } - } + } /** * Escape quotes in a strings depending on the surrounding @@ -201,6 +201,6 @@ class L10n_Scanner_File_Filter_Iterator extends FilterIterator { function accept() { // Skip anything that doesn't need to be localized. $filename = $this->getInnerIterator()->getFilename(); - return in_array(substr(strrchr($filename, '.'), 1), array("php", "info")); + return in_array(pathinfo($filename, PATHINFO_EXTENSION), array("php", "info")); } } |