@@ 407-410 (lines=4) @@ | ||
404 | return self::__OK__; |
|
405 | } |
|
406 | ||
407 | if (!General::validateString($data, $this->get('validator'))) { |
|
408 | $message = __("'%s' contains invalid data. Please check the contents.", array($this->get('label'))); |
|
409 | return self::__INVALID_FIELDS__; |
|
410 | } |
|
411 | } |
|
412 | ||
413 | return self::__OK__; |
@@ 294-300 (lines=7) @@ | ||
291 | if ($this->get('validator') != null) { |
|
292 | $rule = $this->get('validator'); |
|
293 | ||
294 | if (General::validateString($file, $rule) === false) { |
|
295 | $message = __('File chosen in ā%sā does not match allowable file types for that field.', array( |
|
296 | $this->get('label') |
|
297 | )); |
|
298 | ||
299 | return self::__INVALID_FIELDS__; |
|
300 | } |
|
301 | } |
|
302 | // If the developer did not specified any validator, check for the |
|
303 | // blacklisted file types instead |
|
@@ 307-313 (lines=7) @@ | ||
304 | else { |
|
305 | $blacklist = Symphony::Configuration()->get('upload_blacklist', 'admin'); |
|
306 | ||
307 | if (!empty($blacklist) && General::validateString($file, $blacklist)) { |
|
308 | $message = __('File chosen in ā%sā is blacklisted for that field.', array( |
|
309 | $this->get('label') |
|
310 | )); |
|
311 | ||
312 | return self::__INVALID_FIELDS__; |
|
313 | } |
|
314 | } |
|
315 | ||
316 | return self::__OK__; |