From 34eedb503acad59d649f96d3250b40cc1c84047c Mon Sep 17 00:00:00 2001 From: Mike Macgirvin Date: Sun, 26 Sep 2010 17:24:20 -0700 Subject: stronger type checking on comparisons --- mod/photos.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'mod/photos.php') diff --git a/mod/photos.php b/mod/photos.php index 705c76200..693d068e4 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -61,7 +61,7 @@ function photos_post(&$a) { $contact_record = $r[0]; - if(($a->argc > 2) && ($a->argv[1] == 'album')) { + if(($a->argc > 2) && ($a->argv[1] === 'album')) { $album = hex2bin($a->argv[2]); if($album == t('Profile Photos') || $album == t('Contact Photos')) { @@ -390,7 +390,7 @@ function photos_content(&$a) { $datatype = $a->argv[2]; $datum = $a->argv[3]; } - elseif(($a->argc > 2) && ($a->argv[2] == 'upload')) + elseif(($a->argc > 2) && ($a->argv[2] === 'upload')) $datatype = 'upload'; else $datatype = 'summary'; @@ -445,7 +445,7 @@ function photos_content(&$a) { // - if($datatype == 'upload') { + if($datatype === 'upload') { if( ! (local_user() && (get_uid() == $a->data['user']['uid']))) { notice( t('Permission denied.')); return; @@ -455,7 +455,7 @@ function photos_content(&$a) { $albumselect .= ''; if(count($a->data['albums'])) { foreach($a->data['albums'] as $album) { - if(($album['album'] == '') || ($album['album'] == t('Contact Photos'))) + if(($album['album'] === '') || ($album['album'] == t('Contact Photos'))) continue; $albumselect .= ''; } @@ -481,7 +481,7 @@ function photos_content(&$a) { } - if($datatype == 'album') { + if($datatype === 'album') { $album = hex2bin($datum); @@ -504,7 +504,7 @@ function photos_content(&$a) { $o .= '

' . $album . '

'; - if($cmd == 'edit') { + if($cmd === 'edit') { if(($album != t('Profile Photos')) && ($album != t('Contact Photos'))) { if(local_user() && (get_uid() == $a->data['user']['uid'])) { $edit_tpl = load_view_file('view/album_edit.tpl'); @@ -545,7 +545,7 @@ function photos_content(&$a) { } - if($datatype == 'image') { + if($datatype === 'image') { require_once('security.php'); require_once('bbcode.php'); @@ -638,7 +638,7 @@ function photos_content(&$a) { $o .= '
' . $i1[0]['tag'] . '
'; } - if($cmd == 'edit') { + if($cmd === 'edit') { $edit_tpl = load_view_file('view/photo_edit.tpl'); $o .= replace_macros($edit_tpl, array( '$id' => $ph[0]['id'], -- cgit v1.2.3