Skip to content

Commit 7560609

Browse files
author
Loïc
committed
bugfix
1 parent d87ae4a commit 7560609

2 files changed

Lines changed: 23 additions & 10 deletions

File tree

core/class/script.class.php

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -290,17 +290,19 @@ public function execute($_options = null) {
290290
if (isset($_options['speedAndNoErrorReport']) && $_options['speedAndNoErrorReport'] == true) {
291291
$request_http->setNoReportError(true);
292292
$request_http->exec(0.1, 1);
293-
return;
294-
}
295-
$result = trim($request_http->exec($this->getConfiguration('timeout', 2), $this->getConfiguration('maxHttpRetry', 3)));
296-
if($this->getType() == 'info'){
297-
script::$_requet_cache[$request] = $result;
293+
}else{
294+
$result = trim($request_http->exec($this->getConfiguration('timeout', 2), $this->getConfiguration('maxHttpRetry', 3)));
295+
if($this->getType() == 'info'){
296+
script::$_requet_cache[$request] = $result;
297+
}
298298
}
299299
}
300300
if (trim($this->getConfiguration('reponseMustContain')) != '' && strpos($result, trim($this->getConfiguration('reponseMustContain'))) === false) {
301301
throw new Exception(__('La réponse ne contient pas "', __FILE__) . $this->getConfiguration('reponseMustContain') . '" : "' . $result . '"');
302302
}
303-
return $result;
303+
if($this->getType() == 'info'){
304+
return $result;
305+
}
304306
break;
305307
case 'script':
306308
if($this->getType() == 'info' && isset(script::$_requet_cache[$request])){
@@ -326,7 +328,9 @@ public function execute($_options = null) {
326328
script::$_requet_cache[$request] = $result;
327329
}
328330
}
329-
return $result;
331+
if($this->getType() == 'info'){
332+
return $result;
333+
}
330334
case 'xml':
331335
$request = str_replace('"', '', $request);
332336
if($this->getType() == 'info' && isset(script::$_requet_cache[$this->getConfiguration('urlXml')])){
@@ -361,7 +365,9 @@ public function execute($_options = null) {
361365
break;
362366
}
363367
}
364-
return (is_array($json)) ? json_encode($json) : $json;
368+
if($this->getType() == 'info'){
369+
return (is_array($json)) ? json_encode($json) : $json;
370+
}
365371
case 'json':
366372
$request = str_replace('"', '', $request);
367373
if($this->getType() == 'info' && isset(script::$_requet_cache[$this->getConfiguration('urlJson')])){
@@ -398,7 +404,9 @@ public function execute($_options = null) {
398404
break;
399405
}
400406
}
401-
return (is_array($json)) ? json_encode($json) : $json;
407+
if($this->getType() == 'info'){
408+
return (is_array($json)) ? json_encode($json) : $json;
409+
}
402410
case 'html':
403411
$request = str_replace('"', '', $request);
404412
if($this->getType() == 'info' && isset(script::$_requet_cache[$this->getConfiguration('urlHtml')])){
@@ -418,7 +426,9 @@ public function execute($_options = null) {
418426
}
419427
}
420428
phpQuery::newDocumentHTML($html);
421-
return pq(trim($request))->html();
429+
if($this->getType() == 'info'){
430+
return pq(trim($request))->html();
431+
}
422432
}
423433
if ($this->getType() == 'action') {
424434
script::$_requet_cache = array();

docs/fr_FR/changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
>
55
>Pour rappel s'il n'y a pas d'information sur la mise à jour, c'est que celle-ci concerne uniquement de la mise à jour de documentation, de traduction ou de texte
66
7+
# 14/05/2020
8+
9+
- Correction d'un bug sur la mise à jour des commandes info suite à une action
710
- Déplacement des scripts de core/ressources dans data (mise à jour importante à faire et si elle n'est pas faite pourra causer la perte de tous les scripts lors des futurs mises à jour du core)
811

912
# 12/05/2020

0 commit comments

Comments
 (0)