summaryrefslogtreecommitdiff
path: root/inc/media.php
diff options
context:
space:
mode:
authorChristopher Smith <chris@jalakai.co.uk>2014-03-05 21:58:46 +0000
committerChristopher Smith <chris@jalakai.co.uk>2014-03-05 21:58:46 +0000
commit0e80bb5e347ff00c6f81627d8e39dafaaa923bc5 (patch)
tree19e8450aeef463ffe7278e3fb5e8888940113b4a /inc/media.php
parent17dd401e94c682034b7f3d9164ac3523ab01d825 (diff)
downloadrpg-0e80bb5e347ff00c6f81627d8e39dafaaa923bc5.tar.gz
rpg-0e80bb5e347ff00c6f81627d8e39dafaaa923bc5.tar.bz2
use empty() where array values might not be set
Diffstat (limited to 'inc/media.php')
-rw-r--r--inc/media.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/inc/media.php b/inc/media.php
index 4fff95d94..dc76521c6 100644
--- a/inc/media.php
+++ b/inc/media.php
@@ -1018,7 +1018,7 @@ function media_file_tags($meta) {
foreach($fields as $key => $tag){
$t = array();
if (!empty($tag[0])) $t = array($tag[0]);
- if(is_array($tag[3])) $t = array_merge($t,$tag[3]);
+ if(isset($tag[3]) && is_array($tag[3])) $t = array_merge($t,$tag[3]);
$value = media_getTag($t, $meta);
$tags[] = array('tag' => $tag, 'value' => $value);
}
@@ -1779,7 +1779,7 @@ function media_nstree_item($item){
global $INPUT;
$pos = strrpos($item['id'], ':');
$label = substr($item['id'], $pos > 0 ? $pos + 1 : 0);
- if(!$item['label']) $item['label'] = $label;
+ if(empty($item['label'])) $item['label'] = $label;
$ret = '';
if (!($INPUT->str('do') == 'media'))
@@ -1841,7 +1841,7 @@ function media_resize_image($file, $ext, $w, $h=0){
if( $mtime > filemtime($file) ||
media_resize_imageIM($ext,$file,$info[0],$info[1],$local,$w,$h) ||
media_resize_imageGD($ext,$file,$info[0],$info[1],$local,$w,$h) ){
- if($conf['fperm']) @chmod($local, $conf['fperm']);
+ if(!empty($conf['fperm'])) @chmod($local, $conf['fperm']);
return $local;
}
//still here? resizing failed
@@ -1902,7 +1902,7 @@ function media_crop_image($file, $ext, $w, $h=0){
if( $mtime > @filemtime($file) ||
media_crop_imageIM($ext,$file,$info[0],$info[1],$local,$cw,$ch,$cx,$cy) ||
media_resize_imageGD($ext,$file,$cw,$ch,$local,$cw,$ch,$cx,$cy) ){
- if($conf['fperm']) @chmod($local, $conf['fperm']);
+ if(!empty($conf['fperm'])) @chmod($local, $conf['fperm']);
return media_resize_image($local,$ext, $w, $h);
}