Permalink
Browse files

Backwards Compatibility Fix

Fix for backwards compatibility #4645
  • Loading branch information...
1 parent 9a7b91d commit bf9363477c7a24f93a723c2f15f1915a8b72c8ab @OpenCartAddons OpenCartAddons committed on GitHub Jul 30, 2016
Showing with 16 additions and 1 deletion.
  1. +16 −1 upload/system/library/language.php
@@ -31,24 +31,39 @@ public function load($filename, &$data = array()) {
$file = DIR_LANGUAGE . 'english/' . $filename . '.php';
+ // Compatibility code for old extension folders
+ $old_file = DIR_LANGUAGE . 'english/' . str_replace('extension/', '', $filename) . '.php';
+
if (is_file($file)) {
require($file);
+ } elseif (is_file($old_file)) {
+ require($old_file);
}
$file = DIR_LANGUAGE . $this->default . '/' . $filename . '.php';
+ // Compatibility code for old extension folders
+ $old_file = DIR_LANGUAGE . $this->default . '/' . str_replace('extension/', '', $filename) . '.php';
+
if (is_file($file)) {
require($file);
+ } elseif (is_file($old_file)) {
+ require($old_file);
}
$file = DIR_LANGUAGE . $this->directory . '/' . $filename . '.php';
+ // Compatibility code for old extension folders
+ $old_file = DIR_LANGUAGE . $this->directory . '/' . str_replace('extension/', '', $filename) . '.php';
+
if (is_file($file)) {
require($file);
+ } elseif (is_file($old_file)) {
+ require($old_file);
}
$this->data = array_merge($this->data, $_);
return $this->data;
}
-}
+}

0 comments on commit bf93634

Please sign in to comment.