18 require_once SQ_CORE_PACKAGE_PATH.
'/files/file/file.inc';
19 require_once SQ_DATA_PATH.
'/private/conf/tools.inc';
20 require_once SQ_CORE_PACKAGE_PATH.
'/interfaces/bridge/bridge.inc';
41 var $allowed_extensions = Array(
'gif',
'jpg',
'jpeg',
'png');
52 $this->_ser_attrs = TRUE;
53 parent::__construct($assetid);
89 if (in_array(
'attributes', $components) || in_array(
'all', $components)) {
91 $varieties = $this->
attr(
'varieties');
92 $old_base_path = $this->data_path.
'/varieties';
93 $new_base_path = $clone->data_path.
'/varieties';
95 create_directory($new_base_path);
98 $fv = $GLOBALS[
'SQ_SYSTEM']->getFileVersioning();
100 if (isset($varieties[
'data']) && is_array($varieties[
'data'])) {
101 foreach ($varieties[
'data'] as $variety_shadowid => $variety) {
102 $old_variety_path = $old_base_path.
'/'.$variety[
'filename'];
103 $new_variety_path = $new_base_path.
'/'.$variety[
'filename'];
105 if (!copy($old_variety_path, $new_variety_path)) {
106 trigger_localised_error(
'CORE0036', E_USER_WARNING, $old_variety_path, $new_variety_path);
110 if (!$fv->add($clone->data_path_suffix.
'/varieties', $new_variety_path)) {
114 if (!$fv->checkOut($clone->data_path_suffix.
'/varieties/'.$variety[
'filename'], $clone->data_path.
'/varieties')) {
115 trigger_localised_error(
'CORE0103', E_USER_WARNING);
122 return parent::cloneComponents($clone, $components, $override);
136 if (!parent::saveSystemVersion())
return FALSE;
138 $varieties = $this->
attr(
'varieties');
139 if (!empty($varieties[
'lookups'])) {
141 if (!create_directory($this->data_path.
'/.sq_system/varieties')) {
142 trigger_localised_error(
'CORE0050', E_USER_WARNING, $this->name);
147 if (!clear_directory($this->data_path.
'/.sq_system/varieties')) {
148 trigger_localised_error(
'CORE0046', E_USER_WARNING, $this->name);
153 $fv = $GLOBALS[
'SQ_SYSTEM']->getFileVersioning();
156 foreach ($varieties[
'lookups'] as $varietyid) {
157 $variety = $this->
getAsset($this->
id.
':'.$varietyid);
158 if (is_null($variety))
continue;
160 $file_info = $fv->_checkOutCheck($variety->data_path_suffix.
'/'.$variety->attr(
'filename'));
161 $versions[$variety->attr(
'filename')] = $file_info[
'version'];
164 if (!array_to_file($versions,
'versions', $this->data_path.
'/.sq_system/varieties/sq_system_version_no')) {
165 trigger_localised_error(
'CORE0051', E_USER_WARNING, $this->name);
184 if (is_file($this->data_path.
'/.sq_system/varieties/sq_system_version_no')) {
185 include ($this->data_path.
'/.sq_system/varieties/sq_system_version_no');
188 if (!parent::revertToSystemVersion())
return FALSE;
190 $varieties = $this->
attr(
'varieties');
191 if (!empty($varieties[
'lookups'])) {
193 if (!create_directory($this->data_path.
'/varieties')) {
194 trigger_localised_error(
'CORE0049', E_USER_WARNING, $this->name);
199 if (!clear_directory($this->data_path.
'/varieties')) {
200 trigger_localised_error(
'CORE0045', E_USER_WARNING, $this->name);
204 foreach ($varieties[
'lookups'] as $varietyid) {
205 $variety = $this->
getAsset($this->
id.
':'.$varietyid);
206 if (is_null($variety))
continue;
208 $file_version = isset($versions[$variety->attr(
'filename')]) ? $versions[$variety->attr(
'filename')] : NULL;
209 $fv = $GLOBALS[
'SQ_SYSTEM']->getFileVersioning();
212 $rep_path = $variety->data_path_suffix.
'/'.$variety->attr(
'filename');
213 if (!$fv->checkOut($rep_path, $variety->data_path, $file_version)) {
214 trigger_localised_error(
'CORE0044', E_USER_WARNING, $variety->attr(
'filename'));
219 $file_info = $fv->_checkOutCheck($rep_path, $file_version);
220 $fv->_updateFile($file_info[
'fileid'], $variety->data_path_suffix, $variety->data_path.
'/'.$variety->attr(
'filename'));
223 if (!$fv->checkOut($rep_path, $variety->data_path)) {
224 trigger_localised_error(
'CORE0044', E_USER_WARNING, $variety->attr(
'filename'));
244 $info = parent::getExistingFile();
245 if (!empty($info[
'path'])) {
246 $size = getimagesize($info[
'path']);
247 $info[
'width'] = $size[0];
248 $info[
'height'] = $size[1];
272 $title = ($alt !=
'') ? $alt : $this->
attr(
'title');
274 if ($alt ==
'') $alt = $this->
attr(
'alt');
276 $tag =
'<img src="'.$this->getURL().
'" width="'.$this->
attr(
'width').
'" height="'.$this->
attr(
'height').
'" alt="'.htmlentities($alt).
'" title="'.htmlentities($title).
'" />';
277 if ($return)
return $tag;
293 if (!isset($_REQUEST[
'asset_ei_screen'])) {
294 return parent::paintBackend($o);
297 switch ($_REQUEST[
'asset_ei_screen']) {
299 include_once SQ_FUDGE_PATH.
'/var_serialise/var_serialise.inc';
301 $output[
'alt'] = $this->
attr(
'alt');
302 $output[
'width'] = $this->
attr(
'width');
303 $output[
'height'] = $this->
attr(
'height');
304 $output[
'caption'] = $this->
attr(
'caption');
305 $output[
'name'] = $this->name;
307 echo var_serialise($output);
310 return parent::paintBackend($o);
338 function saveVariety($variety, $recreate_image=TRUE, $save_attrs=TRUE, $file_versioning=TRUE, $check_write_access=TRUE)
340 if ($check_write_access && !$this->
writeAccess(
'attributes')) {
341 trigger_localised_error(
'CORE0069', E_USER_WARNING, $this->name, $this->
id);
347 $name = $variety->attr(
'name');
348 if (trim($name) ==
'') {
349 trigger_localised_error(
'CORE0100', E_USER_WARNING);
354 $varieties = $this->
attr(
'varieties');
358 list($assetid, $varietyid) = explode(
':', $variety->id, 2);
359 if ($assetid != $this->
id) {
360 trigger_localised_error(
'CORE0099', E_USER_WARNING);
365 if (isset($varieties[
'data'][$varietyid])) {
366 if ($varieties[
'data'][$varietyid][
'name'] != $name) {
367 trigger_localised_error(
'CORE0097', E_USER_WARNING, $varietyid);
372 trigger_localised_error(
'CORE0098', E_USER_WARNING, $varietyid, $this->name, $this->
id);
379 if (isset($varieties[
'lookups'][$name])) {
380 $varietyid = $varieties[
'lookups'][$name];
382 $varietyid =
'v'.$this->attr(
'variety_count');
383 if (!isset($varieties[
'lookups'])) {
384 $varieties[
'lookups'] = Array();
386 $varieties[
'lookups'][$name] = $varietyid;
388 if (!$this->
setAttrValue(
'variety_count', $this->
attr(
'variety_count') + 1)) {
396 if (!isset($varieties[
'data'])) {
397 $varieties[
'data'] = Array();
399 $varieties[
'data'][$varietyid] = Array();
400 foreach ($variety->vars as $attr_name => $attr_data) {
401 $varieties[
'data'][$varietyid][$attr_name] = $attr_data[
'value'];
408 $variety = $this->
getAsset($this->
id.
':'.$varietyid);
409 if (is_null($variety))
return FALSE;
411 $GLOBALS[
'SQ_SYSTEM']->changeDatabaseConnection(
'db2');
412 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'BEGIN');
415 if ($recreate_image) {
416 if (!$variety->updateImage($file_versioning)) {
417 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'ROLLBACK');
418 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
424 foreach ($variety->vars as $attr_name => $attr_data) {
425 $varieties[
'data'][$varietyid][$attr_name] = $attr_data[
'value'];
433 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'ROLLBACK');
434 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
438 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'COMMIT');
439 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
456 trigger_localised_error(
'CORE0070', E_USER_WARNING, $this->name, $this->
id);
460 if (strpos($varietyid,
':') !== FALSE) {
461 list($assetid, $varietyid) = explode(
':', $varietyid, 2);
462 if ($assetid != $this->
id) {
463 trigger_localised_error(
'CORE088', E_USER_WARNING);
468 $variety = $this->
getAsset($this->
id.
':'.$varietyid);
469 if (is_null($variety))
return FALSE;
471 $GLOBALS[
'SQ_SYSTEM']->changeDatabaseConnection(
'db2');
472 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'BEGIN');
475 if (!$variety->deleteImage()) {
476 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'ROLLBACK');
477 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
481 $varieties = $this->
attr(
'varieties');
483 if (!isset($varieties[
'data'][$varietyid])) {
484 trigger_localised_error(
'CORE87', $varietyid, E_USER_WARNING);
485 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'ROLLBACK');
486 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
490 unset($varieties[
'data'][$varietyid]);
491 $lookup_name = array_search($varietyid, $varieties[
'lookups']);
492 if ($lookup_name !== FALSE) {
493 unset($varieties[
'lookups'][$lookup_name]);
497 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'ROLLBACK');
498 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
503 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'ROLLBACK');
504 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
508 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'COMMIT');
509 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
526 if ($this->status & SQ_SC_STATUS_SAFE_EDITING)
return TRUE;
528 $varieties = $this->
attr(
'varieties');
529 if (!empty($varieties)) {
530 foreach ($varieties[
'lookups'] as $varietyid) {
531 $variety = $this->
getAsset($this->
id.
':'.$varietyid);
532 if (is_null($variety))
continue;
534 if (!$variety->checkFileState($this->effectiveUnrestricted() && $this->
attr(
'allow_unrestricted'))) {
540 return parent::_checkFileState();
554 $GLOBALS[
'SQ_SYSTEM']->changeDatabaseConnection(
'db2');
555 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'BEGIN');
557 if (!parent::updateLookups($auto_add_remaps)) {
558 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'ROLLBACK');
559 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
563 $varieties = $this->
attr(
'varieties');
564 if (!empty($varieties)) {
565 foreach ($varieties[
'lookups'] as $varietyid) {
566 $variety = $this->
getAsset($this->
id.
':'.$varietyid);
567 if (is_null($variety))
continue;
569 if (!$variety->updateLookups()) {
570 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'ROLLBACK');
571 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
578 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'COMMIT');
579 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
603 function getAsset($assetid, $type_code=
'', $mute_errors=FALSE)
606 $id_parts = explode(
':', $assetid);
608 if (isset($id_parts[1])) {
609 $shadowid = $id_parts[1];
615 if ($shadowid{0} ==
'v') {
617 $varieties = $this->
attr(
'varieties');
619 if (!isset($varieties[
'data'][$shadowid])) {
621 trigger_localised_error(
'CORE0073', E_USER_WARNING, $this->
id, $shadowid);
626 $GLOBALS[
'SQ_SYSTEM']->am->includeAsset(
'image_variety');
627 $asset =
new Image_Variety($this->
id.
':'.$shadowid, $varieties[
'data'][$shadowid]);
656 function getLinks($assetid, $link_types, $type_code=
'', $strict_type_code=TRUE, $side_of_link=
'major', $sort_by=NULL)
659 if (!($link_types & SQ_LINK_TYPE_2)) {
667 $ret_type_code = ($side_of_link ==
'major') ?
'image_variety' : $this->
type();
668 if ($strict_type_code) {
669 if (is_array($type_code)) {
670 if (!in_array($ret_type_code, $type_code)) {
674 if ($ret_type_code != $type_code)
return Array();
677 $descendants = $GLOBALS[
'SQ_SYSTEM']->am->getTypeDescendants($type_code, TRUE);
678 if (!in_array($ret_type_code, $descendants)) {
685 if (!isset($this->_tmp[
'getLinks'][$assetid][$side_of_link])) {
688 $varieties = $this->
attr(
'varieties');
690 if (!empty($varieties)) {
693 if ($this->
id == $assetid) {
694 if ($side_of_link ==
'minor') {
696 trigger_localised_error(
'CORE0089', E_USER_ERROR);
700 foreach ($varieties[
'data'] as $varid => $data) {
703 'minorid' => $this->
id.
':'.$varid,
704 'minor_type_code' =>
'image_variety',
705 'majorid' => $this->
id,
707 'link_type' => SQ_LINK_TYPE_2,
708 'is_dependant' => TRUE,
709 'is_exclusive' => TRUE,
724 if ($side_of_link ==
'minor') {
725 list(,$shadowid) = explode(
':', $assetid);
727 if (!isset($varieties[
'data'][$shadowid])) {
728 trigger_localised_error(
'CORE0074', E_USER_WARNING, $assetid, $GLOBALS[
'SQ_SYSTEM']->am->getTypeInfo($this->type(),
'name'), $this->
id);
734 'majorid' => $this->
id,
735 'major_type_code' => $this->
type(),
737 'link_type' => SQ_LINK_TYPE_2,
738 'is_dependant' => TRUE,
739 'is_exclusive' => TRUE,
740 'sort_order' => array_search($assetid, array_keys($varieties[
'data'])),
754 if (!is_null($sort_by)) {
755 uasort($links, create_function(
'$a,$b',
'return $a["'.$sort_by.
'"] < $b["'.$sort_by.
'"];'));
760 $this->_tmp[
'getLinks'][$assetid][$side_of_link] = $links;
764 return $this->_tmp[
'getLinks'][$assetid][$side_of_link];
790 function getChildren($assetid, $type_code=
'', $strict_type_code=TRUE, $dependant=NULL, $sort_by=NULL)
793 if (!is_numeric($assetid))
return Array();
798 $ret_type_code =
'image_variety';
799 if ($strict_type_code) {
800 if (is_array($type_code)) {
801 if (!in_array($ret_type_code, $type_code)) {
805 if ($ret_type_code != $type_code)
return Array();
808 $descendants = $GLOBALS[
'SQ_SYSTEM']->am->getTypeDescendants($type_code, TRUE);
809 if (!in_array($ret_type_code, $descendants)) {
818 $varieties = $this->
attr(
'varieties');
819 if (!empty($varieties)) {
820 foreach ($varieties[
'data'] as $varid => $data) {
821 $children[$this->
id.
':'.$varid] = Array(Array(
'type_code' =>
'image_variety'));
845 function getParents($assetid, $type_code=
'', $strict_type_code=TRUE)
847 if ($assetid == $this->
id || strpos($assetid,
':v') === FALSE) {
849 trigger_localised_error(
'CORE0090', E_USER_ERROR);
852 $parents = $GLOBALS[
'SQ_SYSTEM']->am->getParents($this->
id, $type_code, $strict_type_code);
857 $ret_type_code = $this->
type();
858 if ($strict_type_code) {
859 if (is_array($type_code)) {
860 if (!in_array($ret_type_code, $type_code)) {
864 if ($ret_type_code != $type_code)
return $parents;
867 $descendants = $GLOBALS[
'SQ_SYSTEM']->am->getTypeDescendants($type_code, TRUE);
868 if (!in_array($ret_type_code, $descendants)) {
875 $parents[] = $this->id;
911 $keywords = parent::getAvailableKeywords();
913 $varieties = $this->
attr(
'varieties');
914 if (!empty($varieties)) {
915 foreach ($varieties[
'lookups'] as $varietyid) {
916 $variety = $this->
getAsset($this->
id.
':'.$varietyid);
917 if (is_null($variety))
continue;
918 $keywords[
'image_v_'.$variety->name] =
'Image variety '.$variety->name;
919 $keywords[
'image_v_'.$variety->name.
'_url'] =
'Image variety '.$variety->name.
' URL';
920 $keywords[
'image_v_'.$variety->name.
'_width'] =
'Image variety '.$variety->name.
' Width';
921 $keywords[
'image_v_'.$variety->name.
'_height'] =
'Image variety '.$variety->name.
' Height';
924 $keywords[
'image_width'] =
'Width of the image in pixels';
925 $keywords[
'image_height'] =
'Height of the image in pixels';
926 $keywords[
'image_tag'] =
'HTML IMG tag to display this image';
928 $embedded_data = $this->
attr(
'embedded_data');
929 if (!empty($embedded_data)) {
930 foreach ($embedded_data as $keyword => $value_set) {
931 if (empty($value_set))
continue;
933 $keywords[
'image_embedded_'.$keyword] =
'Embedded Data: "'.$value_set[
'name'].
'"';
950 return $this->
attr(
'width');
963 return $this->
attr(
'height');
1001 $full_keyword = $keyword;
1002 $keyword = parse_keyword($keyword, $modifiers);
1003 $contextid = extract_context_modifier($modifiers);
1005 if ($contextid !== NULL) {
1010 if ((
int)$contextid !== $GLOBALS[
'SQ_SYSTEM']->getContextId()) {
1011 $GLOBALS[
'SQ_SYSTEM']->changeContext($contextid);
1012 $contexted_asset = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($this->
id);
1015 $replacement = $contexted_asset->getKeywordReplacement($keyword);
1018 apply_keyword_modifiers($replacement, $modifiers, Array(
'assetid' => $contexted_asset->id));
1020 unset($contexted_asset);
1021 $GLOBALS[
'SQ_SYSTEM']->restoreContext();
1022 return $replacement;
1028 if (0 === strpos($keyword,
'image_v_')) {
1029 $varieties = $this->
attr(
'varieties');
1030 if (empty($varieties))
return '';
1031 $variety_name = substr($keyword, 8);
1033 if (substr($variety_name, -4) ==
'_url') {
1034 $variety_name = substr($variety_name, 0, strlen($variety_name) - 4);
1036 }
else if (substr($variety_name, -6) ==
'_width') {
1037 $variety_name = substr($variety_name, 0, strlen($variety_name) - 6);
1039 if (isset($size[0])) $replacement = $size[0];
1040 }
else if (substr($variety_name, -7) ==
'_height') {
1041 $variety_name = substr($variety_name, 0, strlen($variety_name) - 7);
1043 if (isset($size[1])) $replacement = $size[1];
1045 $variety_id = array_get_index($varieties[
'lookups'], $variety_name);
1046 if (!empty($variety_id) && !$replacement) {
1047 $variety = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($this->
id.
':'.$variety_id);
1049 $string = $variety->getURL();
1051 $string = $variety->printImageTag($this->
attr(
'alt'), $this->
attr(
'title'), TRUE);
1053 $replacement = $string;
1055 }
else if (0 === strpos($keyword,
'image_embedded_')) {
1056 $embedded_key = substr($keyword, strlen(
'image_embedded_'));
1060 if ($replacement !== NULL) {
1061 if (count($modifiers) > 0) {
1062 apply_keyword_modifiers($replacement, $modifiers, Array(
'assetid' => $this->
id));
1066 $replacement = parent::getKeywordReplacement($full_keyword);
1069 return $replacement;
1084 $varieties = $this->
attr(
'varieties');
1085 if (isset($varieties[
'data'][$varieties[
'lookups'][$variety_name]][
'filename'])) {
1086 $filename = $varieties[
'data'][$varieties[
'lookups'][$variety_name]][
'filename'];
1087 $varietyid = $varieties[
'lookups'][$variety_name];
1088 $variety = $this->
getAsset($this->
id.
':'.$varietyid);
1091 if (is_file($this->data_path.
'/varieties/sq_system_version_no')) {
1092 include ($this->data_path.
'/varieties/sq_system_version_no');
1094 $file_version = isset($versions[$filename]) ? $versions[$filename] : NULL;
1095 $fv = $GLOBALS[
'SQ_SYSTEM']->getFileVersioning();
1096 $rep_path = $variety->data_path_suffix.
'/'.$filename;
1097 if (!$fv->checkOut($rep_path, $variety->data_path, $file_version)) {
1098 trigger_localised_error(
'CORE0044', E_USER_WARNING, $variety->attr(
'filename'));
1103 $file_info = $fv->_checkOutCheck($rep_path, $file_version);
1104 $size = getimagesize($file_info[
'source_file']);
1106 $size = getimagesize($this->data_path.
'/varieties/'.$filename);
1127 $embedded_data = $this->
attr(
'embedded_data');
1128 $data_set = array_get_index($embedded_data, $keyword);
1129 if (is_null($data_set))
return $replacement;
1131 $replacement = implode(
',', $data_set[
'value']);
1133 return $replacement;
1175 function getPermission($assetid, $permission, $granted=NULL, $and_greater=TRUE, $expand_groups=FALSE, $all_info=FALSE)
1231 function getAssetInfo($assetids, $type_code=Array(), $strict_type_code=TRUE, $field=
'')
1234 foreach ($assetids as $assetid) {
1235 $asset = $this->
getAsset($assetid,
'', TRUE);
1238 if ($asset !== NULL) {
1239 if (!empty($field)) {
1240 if ($field ==
'assetid') {
1241 $info[$assetid] = $assetid;
1242 }
else if ($field ==
'type_code') {
1243 $info[$assetid] = $asset->type();
1244 }
else if (in_array($field , Array(
'version',
'name',
'short_name',
'status'))) {
1245 $info[$assetid] = $asset->$field;
1247 $info[$assetid] = $this->$field;
1250 $info[$assetid] = Array(
1251 'assetid' => $assetid,
1252 'type_code' => $asset->type(),
1253 'version' => $asset->version,
1254 'name' => $asset->name,
1255 'short_name' => $asset->short_name,
1256 'status' => $asset->status,
1257 'languages' => $asset->languages,
1258 'charset' => $asset->charset,
1259 'force_secure' => $this->force_secure,
1260 'created' => $asset->created,
1261 'created_userid' => $asset->created_userid,
1262 'updated' => $asset->updated,
1263 'updated_userid' => $asset->updated_userid,
1264 'published' => $asset->published,
1265 'published_userid' => $asset->published_userid,
1266 'status_changed' => $asset->status_changed,
1267 'status_changed_userid' => $asset->status_changed_userid,
1319 function getLink($assetid, $link_type=NULL, $type_code=
'', $strict_type_code=TRUE, $value=NULL, $side_of_link=
'major', $exclusive=NULL)
1365 function countLinks($assetid, $side_of_link=
'major', $link_types=0, $type_code=
'', $strict_type_code=TRUE, $ignore_linkid=0)
1392 function getLinkByAsset($assetid, $other_assetid, $link_types=NULL, $value=NULL, $side_of_link=
'major', $force_array=FALSE, $dependant=NULL, $exclusive=NULL)
1429 function updateLink($linkid, $link_type=NULL, $value=NULL, $sort_order=NULL)
1468 function createAssetLink(&$major, &$minor, $link_type, $value=
'', $sort_order=NULL, $dependant=
'0', $exclusive=
'0', $moving=FALSE)
1500 if (!parent::validFile($info)) {
1504 if (getimagesize($info[
'path']) === FALSE) {
1505 trigger_error(
'Uploaded file is not a valid image file', E_USER_WARNING);