Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

use stream_resolve_include_path instead of custom method

  • Loading branch information...
commit 6397fd9c3881d8f7771e84296c010c0cb18eb89e 1 parent 63ece44
@cweiske cweiske authored
Showing with 1 addition and 18 deletions.
  1. +1 −18 src/Date/HumanDiff.php
View
19 src/Date/HumanDiff.php
@@ -243,7 +243,7 @@ public function setLocale($lang)
$class = 'Date_HumanDiff_Locale_' . $lang;
$file = str_replace('_', '/', $class) . '.php';
- if ($this->isIncludable($file)) {
+ if (stream_resolve_include_path($file) !== false) {
include_once $file;
}
if (!class_exists($class)) {
@@ -258,23 +258,6 @@ public function setLocale($lang)
$this->setTranslator($translator);
return true;
}
-
- /**
- * Check if the given file is includable
- *
- * @param string $file Path to file (relative to include path)
- *
- * @return boolean True if one can include() it
- */
- protected function isIncludable($file)
- {
- $hdl = @fopen($file, 'r', true);
- if ($hdl === false) {
- return false;
- }
- fclose($hdl);
- return true;
- }
}
?>
Please sign in to comment.
Something went wrong with that request. Please try again.