Skip to content

Commit

Permalink
bugfix translate
Browse files Browse the repository at this point in the history
  • Loading branch information
Loïc committed Aug 15, 2016
1 parent d877d27 commit 7f56edc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion core/class/translate.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public static function exec($_content, $_name = '', $_backslash = false) {
return '';
}
$language = self::getLanguage();

if ($language == 'fr_FR' && self::getConfig('generateTranslation') != 1) {
return preg_replace("/{{(.*?)}}/s", '$1', $_content);
}
Expand Down Expand Up @@ -84,7 +85,7 @@ public static function exec($_content, $_name = '', $_backslash = false) {
}
}
if ($_backslash && isset($replace["{{" . $text . "}}"])) {
$replace["{{" . $text . "}}"] = str_replace("'", "\'", str_replace("\'", "'", $replace));
$replace["{{" . $text . "}}"] = str_replace("'", "\'", str_replace("\'", "'", $replace["{{" . $text . "}}"]));
}
if (!isset($replace["{{" . $text . "}}"]) || is_array($replace["{{" . $text . "}}"])) {
$replace["{{" . $text . "}}"] = $text;
Expand Down
8 changes: 5 additions & 3 deletions core/php/downloadFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
require_once dirname(__FILE__) . '/../../core/php/core.inc.php';
include_file('core', 'authentification', 'php');
if (!isConnect()) {
throw new Exception(__('401 - Accès non autorisé', __FILE__));
if (!jeedom::apiAccess(init('apikey'))) {
throw new Exception(__('401 - Accès non autorisé', __FILE__));
}
}
$pathfile = calculPath(urldecode(init('pathfile')));
if (strpos($pathfile, '.php') !== false) {
Expand All @@ -33,12 +35,12 @@
if (!file_exists($pathfile)) {
throw new Exception(__('Fichier non trouvé : ', __FILE__) . $pathfile);
}
} else if (is_dir(str_replace('*','',$pathfile))) {
} else if (is_dir(str_replace('*', '', $pathfile))) {
system('cd ' . dirname($pathfile) . ';tar cfz ' . '/tmp/archive.tar.gz * > /dev/null 2>&1');
$pathfile = '/tmp/archive.tar.gz';
} else {
$pattern = array_pop(explode('/', $pathfile));
system('cd ' . dirname($pathfile) . ';tar cfz ' . '/tmp/archive.tar.gz ' . $pattern .'> /dev/null 2>&1');
system('cd ' . dirname($pathfile) . ';tar cfz ' . '/tmp/archive.tar.gz ' . $pattern . '> /dev/null 2>&1');
$pathfile = '/tmp/archive.tar.gz';
}
$path_parts = pathinfo($pathfile);
Expand Down

0 comments on commit 7f56edc

Please sign in to comment.