From a28deb86741d35a0ab6365ed1455b8e50aa31c81 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 26 Mar 2009 03:09:23 +0000 Subject: Use pathinfo() instead of substr/strchr/etc to get the file extension. --- core/libraries/L10n_Scanner.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core') 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")); } } -- cgit v1.2.3