mirror of
https://github.com/friendica/friendica
synced 2024-12-23 03:20:15 +00:00
stronger type checking on comparisons
This commit is contained in:
parent
1105cdb065
commit
34eedb503a
19 changed files with 64 additions and 64 deletions
10
boot.php
10
boot.php
|
@ -103,7 +103,7 @@ class App {
|
||||||
$this->module = 'home';
|
$this->module = 'home';
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->cmd == '.well-known/host-meta')
|
if($this->cmd === '.well-known/host-meta')
|
||||||
require_once('include/hostxrd.php');
|
require_once('include/hostxrd.php');
|
||||||
|
|
||||||
$this->pager['page'] = ((x($_GET,'page')) ? $_GET['page'] : 1);
|
$this->pager['page'] = ((x($_GET,'page')) ? $_GET['page'] : 1);
|
||||||
|
@ -720,7 +720,7 @@ function webfinger($s) {
|
||||||
$links = $link;
|
$links = $link;
|
||||||
|
|
||||||
foreach($links as $link)
|
foreach($links as $link)
|
||||||
if($link['@attributes']['rel'] && $link['@attributes']['rel'] == 'lrdd')
|
if($link['@attributes']['rel'] && $link['@attributes']['rel'] === 'lrdd')
|
||||||
$tpl = $link['@attributes']['template'];
|
$tpl = $link['@attributes']['template'];
|
||||||
if((empty($tpl)) || (! strpos($tpl, '{uri}')))
|
if((empty($tpl)) || (! strpos($tpl, '{uri}')))
|
||||||
return '';
|
return '';
|
||||||
|
@ -883,10 +883,10 @@ function allowed_email($email) {
|
||||||
if(! function_exists('format_like')) {
|
if(! function_exists('format_like')) {
|
||||||
function format_like($cnt,$arr,$type,$id) {
|
function format_like($cnt,$arr,$type,$id) {
|
||||||
if($cnt == 1)
|
if($cnt == 1)
|
||||||
$o .= $arr[0] . (($type == 'like') ? t(' likes this.') : t(' doesn\'t like this.')) . EOL ;
|
$o .= $arr[0] . (($type === 'like') ? t(' likes this.') : t(' doesn\'t like this.')) . EOL ;
|
||||||
else {
|
else {
|
||||||
$o .= '<span class="fakelink" onclick="openClose(\'' . $type . 'list-' . $id . '\');" >'
|
$o .= '<span class="fakelink" onclick="openClose(\'' . $type . 'list-' . $id . '\');" >'
|
||||||
. $cnt . ' ' . t('people') . '</span> ' . (($type == 'like') ? t('like this.') : t('don\'t like this.')) . EOL ;
|
. $cnt . ' ' . t('people') . '</span> ' . (($type === 'like') ? t('like this.') : t('don\'t like this.')) . EOL ;
|
||||||
$total = count($arr);
|
$total = count($arr);
|
||||||
if($total >= 75)
|
if($total >= 75)
|
||||||
$arr = array_slice($arr,0,74);
|
$arr = array_slice($arr,0,74);
|
||||||
|
@ -895,7 +895,7 @@ function format_like($cnt,$arr,$type,$id) {
|
||||||
$str = implode(', ', $arr);
|
$str = implode(', ', $arr);
|
||||||
if($total >= 75)
|
if($total >= 75)
|
||||||
$str .= t(', and ') . $total - 75 . t(' other people');
|
$str .= t(', and ') . $total - 75 . t(' other people');
|
||||||
$str .= (($type == 'like') ? t(' like this.') : t(' don\'t like this.'));
|
$str .= (($type === 'like') ? t(' like this.') : t(' don\'t like this.'));
|
||||||
$o .= '<div id="' . $type . 'list-' . $id . '" style="display: none;" >' . $str . '</div>';
|
$o .= '<div id="' . $type . 'list-' . $id . '" style="display: none;" >' . $str . '</div>';
|
||||||
}
|
}
|
||||||
return $o;
|
return $o;
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
// login/logout
|
// login/logout
|
||||||
|
|
||||||
if((x($_SESSION,'authenticated')) && (! ($_POST['auth-params'] == 'login'))) {
|
if((x($_SESSION,'authenticated')) && (! ($_POST['auth-params'] === 'login'))) {
|
||||||
if($_POST['auth-params'] == 'logout' || $a->module == "logout") {
|
if($_POST['auth-params'] === 'logout' || $a->module === 'logout') {
|
||||||
unset($_SESSION['authenticated']);
|
unset($_SESSION['authenticated']);
|
||||||
unset($_SESSION['uid']);
|
unset($_SESSION['uid']);
|
||||||
unset($_SESSION['visitor_id']);
|
unset($_SESSION['visitor_id']);
|
||||||
|
@ -46,7 +46,7 @@ else {
|
||||||
|
|
||||||
$encrypted = hash('whirlpool',trim($_POST['password']));
|
$encrypted = hash('whirlpool',trim($_POST['password']));
|
||||||
|
|
||||||
if((x($_POST,'auth-params')) && $_POST['auth-params'] == 'login') {
|
if((x($_POST,'auth-params')) && $_POST['auth-params'] === 'login') {
|
||||||
$r = q("SELECT * FROM `user`
|
$r = q("SELECT * FROM `user`
|
||||||
WHERE `email` = '%s' AND `password` = '%s' AND `blocked` = 0 AND `verified` = 1 LIMIT 1",
|
WHERE `email` = '%s' AND `password` = '%s' AND `blocked` = 0 AND `verified` = 1 LIMIT 1",
|
||||||
dbesc(trim($_POST['login-name'])),
|
dbesc(trim($_POST['login-name'])),
|
||||||
|
|
|
@ -84,7 +84,7 @@ function get_feed_for(&$a, $dfrn_id, $owner_id, $last_update, $direction = 0) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($dfrn_id == '' || $dfrn_id == '*')
|
if($dfrn_id === '' || $dfrn_id === '*')
|
||||||
$sort = 'DESC';
|
$sort = 'DESC';
|
||||||
else
|
else
|
||||||
$sort = 'ASC';
|
$sort = 'ASC';
|
||||||
|
@ -147,7 +147,7 @@ function get_feed_for(&$a, $dfrn_id, $owner_id, $last_update, $direction = 0) {
|
||||||
|
|
||||||
// public feeds get html, our own nodes use bbcode
|
// public feeds get html, our own nodes use bbcode
|
||||||
|
|
||||||
if($dfrn_id == '*') {
|
if($dfrn_id === '*') {
|
||||||
$item['body'] = bbcode($item['body']);
|
$item['body'] = bbcode($item['body']);
|
||||||
$type = 'html';
|
$type = 'html';
|
||||||
}
|
}
|
||||||
|
@ -250,7 +250,7 @@ function get_atom_elements($item) {
|
||||||
|
|
||||||
$raw_author = $item->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10,'author');
|
$raw_author = $item->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10,'author');
|
||||||
if($raw_author) {
|
if($raw_author) {
|
||||||
if($raw_author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['link'][0]['attribs']['']['rel'] == 'photo')
|
if($raw_author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['link'][0]['attribs']['']['rel'] === 'photo')
|
||||||
$res['author-avatar'] = unxmlify($raw_author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['link'][0]['attribs']['']['href']);
|
$res['author-avatar'] = unxmlify($raw_author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['link'][0]['attribs']['']['href']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -327,7 +327,7 @@ function get_atom_elements($item) {
|
||||||
elseif($rawowner[0]['child'][NAMESPACE_DFRN]['uri'][0]['data'])
|
elseif($rawowner[0]['child'][NAMESPACE_DFRN]['uri'][0]['data'])
|
||||||
$res['owner-link'] = unxmlify($rawowner[0]['child'][NAMESPACE_DFRN]['uri'][0]['data']);
|
$res['owner-link'] = unxmlify($rawowner[0]['child'][NAMESPACE_DFRN]['uri'][0]['data']);
|
||||||
|
|
||||||
if($rawowner[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['link'][0]['attribs']['']['rel'] == 'photo')
|
if($rawowner[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['link'][0]['attribs']['']['rel'] === 'photo')
|
||||||
$res['owner-avatar'] = unxmlify($rawowner[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['link'][0]['attribs']['']['href']);
|
$res['owner-avatar'] = unxmlify($rawowner[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['link'][0]['attribs']['']['href']);
|
||||||
elseif($rawowner[0]['child'][NAMESPACE_DFRN]['avatar'][0]['data'])
|
elseif($rawowner[0]['child'][NAMESPACE_DFRN]['avatar'][0]['data'])
|
||||||
$res['owner-avatar'] = unxmlify($rawowner[0]['child'][NAMESPACE_DFRN]['avatar'][0]['data']);
|
$res['owner-avatar'] = unxmlify($rawowner[0]['child'][NAMESPACE_DFRN]['avatar'][0]['data']);
|
||||||
|
@ -349,7 +349,7 @@ function get_atom_elements($item) {
|
||||||
if($rawobj[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['id'][0]['data'])
|
if($rawobj[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['id'][0]['data'])
|
||||||
$res['object'] .= '<id>' . $rawobj[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['id'][0]['data'] . '</id>' . "\n";
|
$res['object'] .= '<id>' . $rawobj[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['id'][0]['data'] . '</id>' . "\n";
|
||||||
|
|
||||||
if($rawobj[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['link'][0]['attribs']['']['rel'] == 'alternate')
|
if($rawobj[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['link'][0]['attribs']['']['rel'] === 'alternate')
|
||||||
$res['object'] .= '<link>' . $rawobj[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['link'][0]['attribs']['']['href'] . '</link>' . "\n";
|
$res['object'] .= '<link>' . $rawobj[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['link'][0]['attribs']['']['href'] . '</link>' . "\n";
|
||||||
if($rawobj[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['title'][0]['data'])
|
if($rawobj[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['title'][0]['data'])
|
||||||
$res['object'] .= '<title>' . $rawobj[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['title'][0]['data'] . '</title>' . "\n";
|
$res['object'] .= '<title>' . $rawobj[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['title'][0]['data'] . '</title>' . "\n";
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
|
|
||||||
$recipients = array();
|
$recipients = array();
|
||||||
|
|
||||||
if($cmd == 'mail') {
|
if($cmd === 'mail') {
|
||||||
|
|
||||||
$message = q("SELECT * FROM `mail` WHERE `id` = %d LIMIT 1",
|
$message = q("SELECT * FROM `mail` WHERE `id` = %d LIMIT 1",
|
||||||
intval($item_id)
|
intval($item_id)
|
||||||
|
@ -89,7 +89,7 @@
|
||||||
|
|
||||||
$parent = $items[0];
|
$parent = $items[0];
|
||||||
|
|
||||||
if($parent['type'] == 'remote') {
|
if($parent['type'] === 'remote') {
|
||||||
// local followup to remote post
|
// local followup to remote post
|
||||||
$followup = true;
|
$followup = true;
|
||||||
$conversant_str = dbesc($parent['contact-id']);
|
$conversant_str = dbesc($parent['contact-id']);
|
||||||
|
@ -152,7 +152,7 @@
|
||||||
'$namdate' => xmlify(datetime_convert('UTC','UTC',$owner['name-date'] . '+00:00' , ATOM_TIME))
|
'$namdate' => xmlify(datetime_convert('UTC','UTC',$owner['name-date'] . '+00:00' , ATOM_TIME))
|
||||||
));
|
));
|
||||||
|
|
||||||
if($cmd == 'mail') {
|
if($cmd === 'mail') {
|
||||||
$atom .= replace_macros($mail_template, array(
|
$atom .= replace_macros($mail_template, array(
|
||||||
'$name' => xmlify($owner['name']),
|
'$name' => xmlify($owner['name']),
|
||||||
'$profile_page' => xmlify($owner['url']),
|
'$profile_page' => xmlify($owner['url']),
|
||||||
|
@ -287,7 +287,7 @@
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(($cmd == 'mail') && ($deliver_status == 0)) {
|
if(($cmd === 'mail') && ($deliver_status == 0)) {
|
||||||
$r = q("UPDATE `mail` SET `delivered` = 1 WHERE `id` = %d LIMIT 1",
|
$r = q("UPDATE `mail` SET `delivered` = 1 WHERE `id` = %d LIMIT 1",
|
||||||
intval($item_id)
|
intval($item_id)
|
||||||
);
|
);
|
||||||
|
|
|
@ -75,7 +75,7 @@
|
||||||
if($debugging)
|
if($debugging)
|
||||||
echo "IMPORTER: {$importer['name']}";
|
echo "IMPORTER: {$importer['name']}";
|
||||||
|
|
||||||
$last_update = (($contact['last-update'] == '0000-00-00 00:00:00')
|
$last_update = (($contact['last-update'] === '0000-00-00 00:00:00')
|
||||||
? datetime_convert('UTC','UTC','now - 30 days','Y-m-d\TH:i:s\Z')
|
? datetime_convert('UTC','UTC','now - 30 days','Y-m-d\TH:i:s\Z')
|
||||||
: datetime_convert('UTC','UTC',$contact['last-update'],'Y-m-d\TH:i:s\Z'));
|
: datetime_convert('UTC','UTC',$contact['last-update'],'Y-m-d\TH:i:s\Z'));
|
||||||
|
|
||||||
|
@ -179,7 +179,7 @@
|
||||||
$name_updated = $elems['name'][0]['attribs'][NAMESPACE_DFRN]['updated'];
|
$name_updated = $elems['name'][0]['attribs'][NAMESPACE_DFRN]['updated'];
|
||||||
$new_name = $elems['name'][0]['data'];
|
$new_name = $elems['name'][0]['data'];
|
||||||
}
|
}
|
||||||
if(($elems['link'][0]['attribs']['']['rel'] == 'photo') && ($elems['link'][0]['attribs'][NAMESPACE_DFRN]['updated'])) {
|
if(($elems['link'][0]['attribs']['']['rel'] === 'photo') && ($elems['link'][0]['attribs'][NAMESPACE_DFRN]['updated'])) {
|
||||||
$photo_timestamp = datetime_convert('UTC','UTC',$elems['link'][0]['attribs'][NAMESPACE_DFRN]['updated']);
|
$photo_timestamp = datetime_convert('UTC','UTC',$elems['link'][0]['attribs'][NAMESPACE_DFRN]['updated']);
|
||||||
$photo_url = $elems['link'][0]['attribs']['']['href'];
|
$photo_url = $elems['link'][0]['attribs']['']['href'];
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ if($a->module_loaded) {
|
||||||
$func($a);
|
$func($a);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(($_SERVER['REQUEST_METHOD'] == 'POST') && (! $a->error)
|
if(($_SERVER['REQUEST_METHOD'] === 'POST') && (! $a->error)
|
||||||
&& (function_exists($a->module . '_post'))
|
&& (function_exists($a->module . '_post'))
|
||||||
&& (! x($_POST,'auth-params'))) {
|
&& (! x($_POST,'auth-params'))) {
|
||||||
$func = $a->module . '_post';
|
$func = $a->module . '_post';
|
||||||
|
|
|
@ -98,7 +98,7 @@ function contacts_content(&$a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if($cmd == 'block') {
|
if($cmd === 'block') {
|
||||||
$blocked = (($orig_record[0]['blocked']) ? 0 : 1);
|
$blocked = (($orig_record[0]['blocked']) ? 0 : 1);
|
||||||
$r = q("UPDATE `contact` SET `blocked` = %d WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
$r = q("UPDATE `contact` SET `blocked` = %d WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
||||||
intval($blocked),
|
intval($blocked),
|
||||||
|
@ -112,7 +112,7 @@ function contacts_content(&$a) {
|
||||||
return; // NOTREACHED
|
return; // NOTREACHED
|
||||||
}
|
}
|
||||||
|
|
||||||
if($cmd == 'ignore') {
|
if($cmd === 'ignore') {
|
||||||
$readonly = (($orig_record[0]['readonly']) ? 0 : 1);
|
$readonly = (($orig_record[0]['readonly']) ? 0 : 1);
|
||||||
$r = q("UPDATE `contact` SET `readonly` = %d WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
$r = q("UPDATE `contact` SET `readonly` = %d WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
||||||
intval($readonly),
|
intval($readonly),
|
||||||
|
@ -126,7 +126,7 @@ function contacts_content(&$a) {
|
||||||
return; // NOTREACHED
|
return; // NOTREACHED
|
||||||
}
|
}
|
||||||
|
|
||||||
if($cmd == 'drop') {
|
if($cmd === 'drop') {
|
||||||
contact_remove($contact_id);
|
contact_remove($contact_id);
|
||||||
notice( t('Contact has been removed.') . EOL );
|
notice( t('Contact has been removed.') . EOL );
|
||||||
goaway($a->get_baseurl() . '/contacts');
|
goaway($a->get_baseurl() . '/contacts');
|
||||||
|
@ -195,7 +195,7 @@ function contacts_content(&$a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(($a->argc == 2) && ($a->argv[1] == 'all'))
|
if(($a->argc == 2) && ($a->argv[1] === 'all'))
|
||||||
$sql_extra = '';
|
$sql_extra = '';
|
||||||
else
|
else
|
||||||
$sql_extra = " AND `blocked` = 0 ";
|
$sql_extra = " AND `blocked` = 0 ";
|
||||||
|
|
|
@ -26,13 +26,13 @@ function dfrn_poll_init(&$a) {
|
||||||
$dfrn_id = substr($dfrn_id,2);
|
$dfrn_id = substr($dfrn_id,2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(($dfrn_id == '') && (! x($_POST,'dfrn_id')) && ($a->argc > 1)) {
|
if(($dfrn_id === '') && (! x($_POST,'dfrn_id')) && ($a->argc > 1)) {
|
||||||
$o = get_feed_for($a, '*', $a->argv[1],$last_update);
|
$o = get_feed_for($a, '*', $a->argv[1],$last_update);
|
||||||
echo $o;
|
echo $o;
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
if((x($type)) && ($type == 'profile')) {
|
if((x($type)) && ($type === 'profile')) {
|
||||||
|
|
||||||
$sql_extra = '';
|
$sql_extra = '';
|
||||||
switch($direction) {
|
switch($direction) {
|
||||||
|
@ -85,7 +85,7 @@ function dfrn_poll_init(&$a) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if((x($type)) && ($type == 'profile-check')) {
|
if((x($type)) && ($type === 'profile-check')) {
|
||||||
|
|
||||||
switch($direction) {
|
switch($direction) {
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -173,7 +173,7 @@ function dfrn_poll_post(&$a) {
|
||||||
$contact_id = $r[0]['id'];
|
$contact_id = $r[0]['id'];
|
||||||
|
|
||||||
|
|
||||||
if($type == 'reputation' && strlen($url)) {
|
if($type === 'reputation' && strlen($url)) {
|
||||||
$r = q("SELECT * FROM `contact` WHERE `url` = '%s' AND `uid` = %d LIMIT 1",
|
$r = q("SELECT * FROM `contact` WHERE `url` = '%s' AND `uid` = %d LIMIT 1",
|
||||||
dbesc($url),
|
dbesc($url),
|
||||||
intval($owner_uid)
|
intval($owner_uid)
|
||||||
|
|
|
@ -173,7 +173,7 @@ function display_content(&$a) {
|
||||||
|
|
||||||
if(($item['parent'] == $item['item_id']) && (! $item['self'])) {
|
if(($item['parent'] == $item['item_id']) && (! $item['self'])) {
|
||||||
|
|
||||||
if($item['type'] == 'wall') {
|
if($item['type'] === 'wall') {
|
||||||
// I do. Put me on the left of the wall-to-wall notice.
|
// I do. Put me on the left of the wall-to-wall notice.
|
||||||
$owner_url = $a->contact['url'];
|
$owner_url = $a->contact['url'];
|
||||||
$owner_photo = $a->contact['thumb'];
|
$owner_photo = $a->contact['thumb'];
|
||||||
|
@ -181,7 +181,7 @@ function display_content(&$a) {
|
||||||
$template = $wallwall;
|
$template = $wallwall;
|
||||||
$commentww = 'ww';
|
$commentww = 'ww';
|
||||||
}
|
}
|
||||||
if($item['type'] == 'remote' && ($item['owner-link'] != $item['author-link'])) {
|
if($item['type'] === 'remote' && ($item['owner-link'] != $item['author-link'])) {
|
||||||
// Could be anybody.
|
// Could be anybody.
|
||||||
$owner_url = $item['owner-link'];
|
$owner_url = $item['owner-link'];
|
||||||
$owner_photo = $item['owner-avatar'];
|
$owner_photo = $item['owner-avatar'];
|
||||||
|
|
|
@ -20,7 +20,7 @@ function group_post(&$a) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(($a->argc == 2) && ($a->argv[1] == 'new')) {
|
if(($a->argc == 2) && ($a->argv[1] === 'new')) {
|
||||||
$name = notags(trim($_POST['groupname']));
|
$name = notags(trim($_POST['groupname']));
|
||||||
$r = group_add(get_uid(),$name);
|
$r = group_add(get_uid(),$name);
|
||||||
if($r) {
|
if($r) {
|
||||||
|
@ -88,13 +88,13 @@ function group_content(&$a) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(($a->argc == 2) && ($a->argv[1] == 'new')) {
|
if(($a->argc == 2) && ($a->argv[1] === 'new')) {
|
||||||
$tpl = load_view_file('view/group_new.tpl');
|
$tpl = load_view_file('view/group_new.tpl');
|
||||||
$o .= replace_macros($tpl,array());
|
$o .= replace_macros($tpl,array());
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(($a->argc == 3) && ($a->argv[1] == 'drop')) {
|
if(($a->argc == 3) && ($a->argv[1] === 'drop')) {
|
||||||
if(intval($a->argv[2])) {
|
if(intval($a->argv[2])) {
|
||||||
$r = q("SELECT `name` FROM `group` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
$r = q("SELECT `name` FROM `group` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
||||||
intval($a->argv[2]),
|
intval($a->argv[2]),
|
||||||
|
|
|
@ -95,9 +95,9 @@ function item_post(&$a) {
|
||||||
|
|
||||||
$post_type = notags(trim($_POST['type']));
|
$post_type = notags(trim($_POST['type']));
|
||||||
|
|
||||||
if($post_type == 'net-comment') {
|
if($post_type === 'net-comment') {
|
||||||
if($parent_item !== null) {
|
if($parent_item !== null) {
|
||||||
if($parent_item['type'] == 'remote') {
|
if($parent_item['type'] === 'remote') {
|
||||||
$post_type = 'remote-comment';
|
$post_type = 'remote-comment';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -107,7 +107,7 @@ function item_post(&$a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
$wall = 0;
|
$wall = 0;
|
||||||
if($post_type == 'wall' || $post_type == 'wall-comment')
|
if($post_type === 'wall' || $post_type === 'wall-comment')
|
||||||
$wall = 1;
|
$wall = 1;
|
||||||
|
|
||||||
if(! strlen($verb))
|
if(! strlen($verb))
|
||||||
|
@ -244,7 +244,7 @@ function item_content(&$a) {
|
||||||
|
|
||||||
$uid = $_SESSION['uid'];
|
$uid = $_SESSION['uid'];
|
||||||
|
|
||||||
if(($a->argc == 3) && ($a->argv[1] == 'drop') && intval($a->argv[2])) {
|
if(($a->argc == 3) && ($a->argv[1] === 'drop') && intval($a->argv[2])) {
|
||||||
|
|
||||||
// locate item to be deleted
|
// locate item to be deleted
|
||||||
|
|
||||||
|
|
|
@ -121,9 +121,9 @@ function like_content(&$a) {
|
||||||
<content>$body</content>
|
<content>$body</content>
|
||||||
</object>
|
</object>
|
||||||
EOT;
|
EOT;
|
||||||
if($verb == 'like')
|
if($verb === 'like')
|
||||||
$bodyverb = t('likes');
|
$bodyverb = t('likes');
|
||||||
if($verb == 'dislike')
|
if($verb === 'dislike')
|
||||||
$bodyverb = t('doesn\'t like');
|
$bodyverb = t('doesn\'t like');
|
||||||
|
|
||||||
if(! isset($bodyverb))
|
if(! isset($bodyverb))
|
||||||
|
|
|
@ -103,11 +103,11 @@ function message_content(&$a) {
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
||||||
if(($a->argc == 3) && ($a->argv[1] == 'drop' || $a->argv[1] == 'dropconv')) {
|
if(($a->argc == 3) && ($a->argv[1] === 'drop' || $a->argv[1] === 'dropconv')) {
|
||||||
if(! intval($a->argv[2]))
|
if(! intval($a->argv[2]))
|
||||||
return;
|
return;
|
||||||
$cmd = $a->argv[1];
|
$cmd = $a->argv[1];
|
||||||
if($cmd == 'drop') {
|
if($cmd === 'drop') {
|
||||||
$r = q("DELETE FROM `mail` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
$r = q("DELETE FROM `mail` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
||||||
intval($a->argv[2]),
|
intval($a->argv[2]),
|
||||||
intval($_SESSION['uid'])
|
intval($_SESSION['uid'])
|
||||||
|
@ -135,7 +135,7 @@ function message_content(&$a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if(($a->argc > 2) && ($a->argv[1] == 'redeliver') && intval($a->argv[2])) {
|
if(($a->argc > 2) && ($a->argv[1] === 'redeliver') && intval($a->argv[2])) {
|
||||||
$post_id = intval($a->argv[2]);
|
$post_id = intval($a->argv[2]);
|
||||||
$php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
|
$php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
|
||||||
$proc_debug = get_config('system','proc_debug');
|
$proc_debug = get_config('system','proc_debug');
|
||||||
|
@ -148,7 +148,7 @@ function message_content(&$a) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(($a->argc > 1) && ($a->argv[1] == 'new')) {
|
if(($a->argc > 1) && ($a->argv[1] === 'new')) {
|
||||||
|
|
||||||
$tpl = load_view_file('view/msg-header.tpl');
|
$tpl = load_view_file('view/msg-header.tpl');
|
||||||
|
|
||||||
|
@ -174,7 +174,7 @@ function message_content(&$a) {
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(($a->argc == 1) || ($a->argc == 2 && $a->argv[1] == 'sent')) {
|
if(($a->argc == 1) || ($a->argc == 2 && $a->argv[1] === 'sent')) {
|
||||||
|
|
||||||
$o .= $header;
|
$o .= $header;
|
||||||
|
|
||||||
|
|
|
@ -172,7 +172,7 @@ function network_content(&$a, $update = 0) {
|
||||||
|
|
||||||
if(($item['parent'] == $item['item_id']) && (! $item['self'])) {
|
if(($item['parent'] == $item['item_id']) && (! $item['self'])) {
|
||||||
|
|
||||||
if($item['type'] == 'wall') {
|
if($item['type'] === 'wall') {
|
||||||
// I do. Put me on the left of the wall-to-wall notice.
|
// I do. Put me on the left of the wall-to-wall notice.
|
||||||
$owner_url = $a->contact['url'];
|
$owner_url = $a->contact['url'];
|
||||||
$owner_photo = $a->contact['thumb'];
|
$owner_photo = $a->contact['thumb'];
|
||||||
|
@ -180,7 +180,7 @@ function network_content(&$a, $update = 0) {
|
||||||
$template = $wallwall;
|
$template = $wallwall;
|
||||||
$commentww = 'ww';
|
$commentww = 'ww';
|
||||||
}
|
}
|
||||||
if($item['type'] == 'remote' && ($item['owner-link'] != $item['author-link'])) {
|
if($item['type'] === 'remote' && ($item['owner-link'] != $item['author-link'])) {
|
||||||
// Could be anybody.
|
// Could be anybody.
|
||||||
$owner_url = $item['owner-link'];
|
$owner_url = $item['owner-link'];
|
||||||
$owner_photo = $item['owner-avatar'];
|
$owner_photo = $item['owner-avatar'];
|
||||||
|
|
|
@ -61,7 +61,7 @@ function photos_post(&$a) {
|
||||||
$contact_record = $r[0];
|
$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]);
|
$album = hex2bin($a->argv[2]);
|
||||||
|
|
||||||
if($album == t('Profile Photos') || $album == t('Contact Photos')) {
|
if($album == t('Profile Photos') || $album == t('Contact Photos')) {
|
||||||
|
@ -390,7 +390,7 @@ function photos_content(&$a) {
|
||||||
$datatype = $a->argv[2];
|
$datatype = $a->argv[2];
|
||||||
$datum = $a->argv[3];
|
$datum = $a->argv[3];
|
||||||
}
|
}
|
||||||
elseif(($a->argc > 2) && ($a->argv[2] == 'upload'))
|
elseif(($a->argc > 2) && ($a->argv[2] === 'upload'))
|
||||||
$datatype = 'upload';
|
$datatype = 'upload';
|
||||||
else
|
else
|
||||||
$datatype = 'summary';
|
$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']))) {
|
if( ! (local_user() && (get_uid() == $a->data['user']['uid']))) {
|
||||||
notice( t('Permission denied.'));
|
notice( t('Permission denied.'));
|
||||||
return;
|
return;
|
||||||
|
@ -455,7 +455,7 @@ function photos_content(&$a) {
|
||||||
$albumselect .= '<option value="" selected="selected" > </option>';
|
$albumselect .= '<option value="" selected="selected" > </option>';
|
||||||
if(count($a->data['albums'])) {
|
if(count($a->data['albums'])) {
|
||||||
foreach($a->data['albums'] as $album) {
|
foreach($a->data['albums'] as $album) {
|
||||||
if(($album['album'] == '') || ($album['album'] == t('Contact Photos')))
|
if(($album['album'] === '') || ($album['album'] == t('Contact Photos')))
|
||||||
continue;
|
continue;
|
||||||
$albumselect .= '<option value="' . $album['album'] . '">' . $album['album'] . '</option>';
|
$albumselect .= '<option value="' . $album['album'] . '">' . $album['album'] . '</option>';
|
||||||
}
|
}
|
||||||
|
@ -481,7 +481,7 @@ function photos_content(&$a) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($datatype == 'album') {
|
if($datatype === 'album') {
|
||||||
|
|
||||||
$album = hex2bin($datum);
|
$album = hex2bin($datum);
|
||||||
|
|
||||||
|
@ -504,7 +504,7 @@ function photos_content(&$a) {
|
||||||
|
|
||||||
$o .= '<h3>' . $album . '</h3>';
|
$o .= '<h3>' . $album . '</h3>';
|
||||||
|
|
||||||
if($cmd == 'edit') {
|
if($cmd === 'edit') {
|
||||||
if(($album != t('Profile Photos')) && ($album != t('Contact Photos'))) {
|
if(($album != t('Profile Photos')) && ($album != t('Contact Photos'))) {
|
||||||
if(local_user() && (get_uid() == $a->data['user']['uid'])) {
|
if(local_user() && (get_uid() == $a->data['user']['uid'])) {
|
||||||
$edit_tpl = load_view_file('view/album_edit.tpl');
|
$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('security.php');
|
||||||
require_once('bbcode.php');
|
require_once('bbcode.php');
|
||||||
|
@ -638,7 +638,7 @@ function photos_content(&$a) {
|
||||||
$o .= '<div id="in-this-photo">' . $i1[0]['tag'] . '</div>';
|
$o .= '<div id="in-this-photo">' . $i1[0]['tag'] . '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if($cmd == 'edit') {
|
if($cmd === 'edit') {
|
||||||
$edit_tpl = load_view_file('view/photo_edit.tpl');
|
$edit_tpl = load_view_file('view/photo_edit.tpl');
|
||||||
$o .= replace_macros($edit_tpl, array(
|
$o .= replace_macros($edit_tpl, array(
|
||||||
'$id' => $ph[0]['id'],
|
'$id' => $ph[0]['id'],
|
||||||
|
|
|
@ -56,7 +56,7 @@ function profile_init(&$a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
$profile = 0;
|
$profile = 0;
|
||||||
if((local_user()) && ($a->argc > 2) && ($a->argv[2] == 'view')) {
|
if((local_user()) && ($a->argc > 2) && ($a->argv[2] === 'view')) {
|
||||||
$which = $a->user['nickname'];
|
$which = $a->user['nickname'];
|
||||||
$profile = $a->argv[1];
|
$profile = $a->argv[1];
|
||||||
}
|
}
|
||||||
|
@ -129,7 +129,7 @@ function profile_content(&$a, $update = 0) {
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
||||||
if($tab == 'profile') {
|
if($tab === 'profile') {
|
||||||
$lang = get_config('system','language');
|
$lang = get_config('system','language');
|
||||||
if($lang && file_exists("view/$lang/profile_advanced.php"))
|
if($lang && file_exists("view/$lang/profile_advanced.php"))
|
||||||
require_once("view/$lang/profile_advanced.php");
|
require_once("view/$lang/profile_advanced.php");
|
||||||
|
@ -164,7 +164,7 @@ function profile_content(&$a, $update = 0) {
|
||||||
// This is ugly, but we can't pass the profile_uid through the session to the ajax updater,
|
// This is ugly, but we can't pass the profile_uid through the session to the ajax updater,
|
||||||
// because browser prefetching might change it on us. We have to deliver it with the page.
|
// because browser prefetching might change it on us. We have to deliver it with the page.
|
||||||
|
|
||||||
if($tab == 'posts' && (! $a->pager['start'])) {
|
if($tab === 'posts' && (! $a->pager['start'])) {
|
||||||
$o .= '<div id="live-profile"></div>' . "\r\n";
|
$o .= '<div id="live-profile"></div>' . "\r\n";
|
||||||
$o .= "<script> var profile_uid = " . $a->profile['profile_uid'] . "; </script>\r\n";
|
$o .= "<script> var profile_uid = " . $a->profile['profile_uid'] . "; </script>\r\n";
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ function profiles_post(&$a) {
|
||||||
|
|
||||||
$namechanged = false;
|
$namechanged = false;
|
||||||
|
|
||||||
if(($a->argc > 1) && ($a->argv[1] != "new") && intval($a->argv[1])) {
|
if(($a->argc > 1) && ($a->argv[1] !== "new") && intval($a->argv[1])) {
|
||||||
$orig = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
$orig = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
||||||
intval($a->argv[1]),
|
intval($a->argv[1]),
|
||||||
intval($_SESSION['uid'])
|
intval($_SESSION['uid'])
|
||||||
|
@ -163,7 +163,7 @@ function profiles_content(&$a) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(($a->argc > 2) && ($a->argv[1] == "drop") && intval($a->argv[2])) {
|
if(($a->argc > 2) && ($a->argv[1] === "drop") && intval($a->argv[2])) {
|
||||||
$r = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d AND `is-default` = 0 AND `self` = 0 LIMIT 1",
|
$r = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d AND `is-default` = 0 AND `self` = 0 LIMIT 1",
|
||||||
intval($a->argv[2]),
|
intval($a->argv[2]),
|
||||||
intval($_SESSION['uid'])
|
intval($_SESSION['uid'])
|
||||||
|
@ -195,7 +195,7 @@ function profiles_content(&$a) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(($a->argc > 1) && ($a->argv[1] == 'new')) {
|
if(($a->argc > 1) && ($a->argv[1] === 'new')) {
|
||||||
|
|
||||||
$r0 = q("SELECT `id` FROM `profile` WHERE `uid` = %d",
|
$r0 = q("SELECT `id` FROM `profile` WHERE `uid` = %d",
|
||||||
intval($_SESSION['uid']));
|
intval($_SESSION['uid']));
|
||||||
|
@ -225,7 +225,7 @@ function profiles_content(&$a) {
|
||||||
goaway($a->get_baseurl() . '/profiles');
|
goaway($a->get_baseurl() . '/profiles');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(($a->argc > 2) && ($a->argv[1] == 'clone')) {
|
if(($a->argc > 2) && ($a->argv[1] === 'clone')) {
|
||||||
|
|
||||||
$r0 = q("SELECT `id` FROM `profile` WHERE `uid` = %d",
|
$r0 = q("SELECT `id` FROM `profile` WHERE `uid` = %d",
|
||||||
intval($_SESSION['uid']));
|
intval($_SESSION['uid']));
|
||||||
|
|
|
@ -29,7 +29,7 @@ function regmod_content(&$a) {
|
||||||
intval($register[0]['uid'])
|
intval($register[0]['uid'])
|
||||||
);
|
);
|
||||||
|
|
||||||
if($cmd == 'deny') {
|
if($cmd === 'deny') {
|
||||||
|
|
||||||
$r = q("DELETE FROM `user` WHERE `uid` = %d LIMIT 1",
|
$r = q("DELETE FROM `user` WHERE `uid` = %d LIMIT 1",
|
||||||
intval($register[0]['uid'])
|
intval($register[0]['uid'])
|
||||||
|
@ -49,7 +49,7 @@ function regmod_content(&$a) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($cmd == 'allow') {
|
if($cmd === 'allow') {
|
||||||
|
|
||||||
if(! count($user))
|
if(! count($user))
|
||||||
killme();
|
killme();
|
||||||
|
|
|
@ -215,7 +215,7 @@ function settings_content(&$a) {
|
||||||
if($files) {
|
if($files) {
|
||||||
foreach($files as $file) {
|
foreach($files as $file) {
|
||||||
$f = basename($file);
|
$f = basename($file);
|
||||||
$selected = (($f == $_SESSION['theme']) || ($f == 'default' && (! x($_SESSION,'theme')))
|
$selected = (($f == $_SESSION['theme']) || ($f === 'default' && (! x($_SESSION,'theme')))
|
||||||
? ' selected="selected" ' : '' );
|
? ' selected="selected" ' : '' );
|
||||||
$theme_selector .= '<option val="' . basename($file) . '"' . $selected . '>' . basename($file) . '</option>';
|
$theme_selector .= '<option val="' . basename($file) . '"' . $selected . '>' . basename($file) . '</option>';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue