public function validate() { $res = parent::validate(); // width validation if (!$this->isValidWidth()) { $this->errors[] = sprintf("Max. Allowed Image Width is %d px", $this->allowedMaxImageWidth); $res = false; } return $res; }
public function validate() { if (parent::validate() === false) { return false; } try { $result = $this->isValidMime(); if ($result === false) { $this->errors[] = _t('File.INVALIDMIME', 'File extension does not match known MIME type'); return false; } } catch (MimeUploadValidator_Exception $e) { $this->errors[] = _t('File.FAILEDMIMECHECK', 'MIME validation failed: {message}', 'Argument 1: Message about why MIME type detection failed', array('message' => $e->getMessage())); return false; } return true; }