diff --git a/htdocs/core/class/validate.class.php b/htdocs/core/class/validate.class.php index 1b2447dc23a..389bb708e82 100644 --- a/htdocs/core/class/validate.class.php +++ b/htdocs/core/class/validate.class.php @@ -61,6 +61,11 @@ class Validate $this->outputLang = $outputLang; } + if (!is_object($this->outputLang) || !method_exists($outputLang, 'load')) { + return false; + } + + /** @var Translate $outputLang */ $outputLang->load('validate'); $this->db = $db; @@ -212,7 +217,7 @@ class Validate /** * Check Duration validity * - * @param string $duration to validate + * @param mixed $duration to validate * @return boolean Validity is ok or not */ public function isDuration($duration) diff --git a/htdocs/core/lib/images.lib.php b/htdocs/core/lib/images.lib.php index 0ccb6a415fc..6b973d89887 100644 --- a/htdocs/core/lib/images.lib.php +++ b/htdocs/core/lib/images.lib.php @@ -388,7 +388,7 @@ function dolRotateImage($file_path) * Add exif orientation correction for image * * @param string $fileSource Full path to source image to rotate - * @param string $fileDest string : Full path to image to rotate | false return gd img | null the raw image stream will be outputted directly + * @param string|bool $fileDest string : Full path to image to rotate | false return gd img | null the raw image stream will be outputted directly * @param int $quality output image quality * @return bool : true on success or false on failure or gd img if $fileDest is false. */ @@ -630,7 +630,7 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small', } // replace image with good orientation - if (!empty($rotated)) { + if (!empty($rotated) && isset($trueImgWidth) && isset($trueImgHeight)) { $img = $rotated; $imgWidth = $trueImgWidth; $imgHeight = $trueImgHeight; diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index b90ea227037..675b0a80ab9 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -348,8 +348,10 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it */ public $hidden = false; - - + /** + * @var string url to check for module update + */ + public $url_last_version; /** diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 6d8b54d1954..f531d221aff 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -747,7 +747,7 @@ class Project extends CommonObject 'fk_projet' => $projectkey, 'ids' => $ids, ); - $reshook = $hookmanager->executeHooks('getElementList', $parameters, $object, $action); + $reshook = $hookmanager->executeHooks('getElementList', $parameters); if ($reshook > 0) { $sql = $hookmanager->resPrint; } else { diff --git a/htdocs/theme/eldy/manifest.json.php b/htdocs/theme/eldy/manifest.json.php index ec6472c80e6..6f3dc2e9cbc 100644 --- a/htdocs/theme/eldy/manifest.json.php +++ b/htdocs/theme/eldy/manifest.json.php @@ -101,7 +101,7 @@ if (!empty($conf->global->MAIN_MANIFEST_APPLI_LOGO_URL)) { $iconPath = $conf->mycompany->dir_output.'/'.$iconRelativePath; if (is_readable($iconPath)) { $imgSize = getimagesize($iconPath); - if ($imgSize) { + if (!empty($imgSize)) { $icon = new stdClass(); $icon->src = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode($iconRelativePath); $icon->sizes = $imgSize[0]."x".$imgSize[1];