diff --git a/include/Webservices/Utils.php b/include/Webservices/Utils.php index 1f56c063a96623dc2df57953a83e56d164681e94..720e2c5f5af0780ba80a87c6bc5a88299d55d543 100644 --- a/include/Webservices/Utils.php +++ b/include/Webservices/Utils.php @@ -487,10 +487,10 @@ function vtws_CreateCompanyLogoFile($fieldname) { copy($uploaddir.$binFile, $uploaddir.'application.ico'); return $binFile; } - throw new WebServiceException(WebServiceErrorCode::$INVALIDTOKEN, + throw new WebServiceException(WebServiceErrorCode::$FAILED_TO_UPDATE, "$fieldname wrong file type given for upload"); } - throw new WebServiceException(WebServiceErrorCode::$INVALIDTOKEN, "$fieldname file upload failed"); + throw new WebServiceException(WebServiceErrorCode::$FAILED_TO_UPDATE, "$fieldname file upload failed"); } function vtws_getActorEntityName ($name, $idList) { diff --git a/include/Webservices/WebServiceErrorCode.php b/include/Webservices/WebServiceErrorCode.php index 7b7a06d2327c04a08465a6019360ddeb60581a56..128583de9f289ceecc95973582fe6e3760f56639 100644 --- a/include/Webservices/WebServiceErrorCode.php +++ b/include/Webservices/WebServiceErrorCode.php @@ -43,6 +43,7 @@ public static $FAILED_TO_CREATE = "FAILED_TO_CREATE"; public static $INACTIVECURRENCY = "CURRENCY_INACTIVE"; public static $PASSWORDNOTSTRONG = "PASSWORD_NOT_STRONG"; + public static $FAILED_TO_UPDATE = "FAILED_TO_UPDATE"; } ?> diff --git a/vtlib/Vtiger/Functions.php b/vtlib/Vtiger/Functions.php index 24fd4b3b4034fdb32713f38e9a0696ce646f45b4..ab4d4a3286370e99d13ff46dda45cfd6759de1c6 100644 --- a/vtlib/Vtiger/Functions.php +++ b/vtlib/Vtiger/Functions.php @@ -653,8 +653,7 @@ class Vtiger_Functions { if ($saveimage) { $mimeType = mime_content_type($file_details['tmp_name']); list($mimeTypeContents, $mimeSubtype) = explode('/', $mimeType); - - if (strtolower($mimeContents) !== 'image' || !in_array($mimeSubtype, $allowedImageFormats)) { + if (strtolower($mimeTypeContents) !== 'image' || !in_array($mimeSubtype, $allowedImageFormats)) { $saveimage = false; } }