From ad4cdf2a9d2e3965a7526cac26b99369b4ce2111 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Thu, 8 Jun 2017 21:03:44 -0400 Subject: [PATCH] Replace lowercase operators --- boot.php | 4 +-- include/NotificationsManager.php | 8 +++--- include/api.php | 8 +++--- include/auth_ejabberd.php | 2 +- include/bbcode.php | 10 +++---- include/dbstructure.php | 2 +- include/delivery.php | 6 ++--- include/discover_poco.php | 4 +-- include/email.php | 6 ++--- include/enotify.php | 2 +- include/html2bbcode.php | 2 +- include/html2plain.php | 12 ++++----- include/items.php | 6 ++--- include/message.php | 2 +- include/msgclean.php | 46 ++++++++++++++++---------------- include/notifier.php | 4 +-- include/onepoll.php | 10 +++---- include/photos.php | 2 +- include/quoteconvert.php | 2 +- include/xml.php | 2 +- mod/settings.php | 2 +- util/php2po.php | 2 +- util/typo.php | 14 +++++----- view/theme/vier/theme.php | 2 +- 24 files changed, 80 insertions(+), 80 deletions(-) diff --git a/boot.php b/boot.php index 6fd7c30372..5417e0fa23 100644 --- a/boot.php +++ b/boot.php @@ -1424,10 +1424,10 @@ function clear_cache($basepath = "", $path = "") { if ($dh = opendir($path)) { while (($file = readdir($dh)) !== false) { $fullpath = $path . "/" . $file; - if ((filetype($fullpath) == "dir") and ($file != ".") and ($file != "..")) { + if ((filetype($fullpath) == "dir") && ($file != ".") && ($file != "..")) { clear_cache($basepath, $fullpath); } - if ((filetype($fullpath) == "file") and (filectime($fullpath) < (time() - $cachetime))) { + if ((filetype($fullpath) == "file") && (filectime($fullpath) < (time() - $cachetime))) { unlink($fullpath); } } diff --git a/include/NotificationsManager.php b/include/NotificationsManager.php index ad0ede6dbe..57c315c9d7 100644 --- a/include/NotificationsManager.php +++ b/include/NotificationsManager.php @@ -512,7 +512,7 @@ class NotificationsManager { $myurl = substr($myurl,strpos($myurl,'://')+3); $myurl = str_replace(array('www.','.'),array('','\\.'),$myurl); $diasp_url = str_replace('/profile/','/u/',$myurl); - $sql_extra = sprintf(" AND ( `item`.`author-link` regexp '%s' or `item`.`tag` regexp '%s' or `item`.`tag` regexp '%s' ) ", + $sql_extra = sprintf(" AND ( `item`.`author-link` regexp '%s' OR `item`.`tag` regexp '%s' OR `item`.`tag` regexp '%s' ) ", dbesc($myurl . '$'), dbesc($myurl . '\\]'), dbesc($diasp_url . '\\]') @@ -829,11 +829,11 @@ class NotificationsManager { } /** - * @brief Check for missing contact data and try to fetch the data from + * @brief Check for missing contact data and try to fetch the data from * from other sources - * + * * @param array $arr The input array with the intro data - * + * * @return array The array with the intro data */ private function getMissingIntroData($arr) { diff --git a/include/api.php b/include/api.php index bc40e420b0..16ff0f4a05 100644 --- a/include/api.php +++ b/include/api.php @@ -2178,7 +2178,7 @@ $called_api = null; `contact`.`id` AS `cid` FROM `item`, `contact` WHERE `item`.`uid` = %d - AND `item`.`visible` = 1 and `item`.`moderated` = 0 AND `item`.`deleted` = 0 + AND `item`.`visible` = 1 AND `item`.`moderated` = 0 AND `item`.`deleted` = 0 AND `item`.`starred` = 1 AND `contact`.`id` = `item`.`contact-id` AND (NOT `contact`.`blocked` OR `contact`.`pending`) @@ -2263,13 +2263,13 @@ $called_api = null; $statustitle = trim($item['title']); - if (($statustitle != '') and (strpos($statusbody, $statustitle) !== false)) { + if (($statustitle != '') && (strpos($statusbody, $statustitle) !== false)) { $statustext = trim($statusbody); } else { $statustext = trim($statustitle."\n\n".$statusbody); } - if (($item["network"] == NETWORK_FEED) and (strlen($statustext)> 1000)) { + if (($item["network"] == NETWORK_FEED) && (strlen($statustext)> 1000)) { $statustext = substr($statustext, 0, 1000)."... \n".$item["plink"]; } @@ -3982,7 +3982,7 @@ $called_api = null; } function prepare_photo_data($type, $scale, $photo_id) { - $scale_sql = ($scale === false ? "" : sprintf("and scale=%d", intval($scale))); + $scale_sql = ($scale === false ? "" : sprintf("AND scale=%d", intval($scale))); $data_sql = ($scale === false ? "" : "data, "); // added allow_cid, allow_gid, deny_cid, deny_gid to output as string like stored in database diff --git a/include/auth_ejabberd.php b/include/auth_ejabberd.php index 9211c5baf0..490ea0d1cb 100755 --- a/include/auth_ejabberd.php +++ b/include/auth_ejabberd.php @@ -89,7 +89,7 @@ class exAuth { // Open the logfile if the logfile name is defined if ($this->sLogFile != '') - $this->rLogFile = fopen($this->sLogFile, "a") or die("Error opening log file: ". $this->sLogFile); + $this->rLogFile = fopen($this->sLogFile, "a") || die("Error opening log file: ". $this->sLogFile); $this->writeLog("[exAuth] start"); diff --git a/include/bbcode.php b/include/bbcode.php index 2b2d7fc937..0c4e12c9ad 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -147,7 +147,7 @@ function cleancss($input) { for ($i = 0; $i < strlen($input); $i++) { $char = substr($input, $i, 1); - if (($char >= "a") and ($char <= "z")) { + if (($char >= "a") && ($char <= "z")) { $cleaned .= $char; } @@ -1126,7 +1126,7 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa // Check for [spoiler] text // handle nested quotes $endlessloop = 0; - while ((strpos($Text, "[/spoiler]") !== false) and (strpos($Text, "[spoiler]") !== false) and (++$endlessloop < 20)) { + while ((strpos($Text, "[/spoiler]") !== false) && (strpos($Text, "[spoiler]") !== false) && (++$endlessloop < 20)) { $Text = preg_replace("/\[spoiler\](.*?)\[\/spoiler\]/ism", "$SpoilerLayout", $Text); } @@ -1136,7 +1136,7 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa // handle nested quotes $endlessloop = 0; - while ((strpos($Text, "[/spoiler]")!== false) and (strpos($Text, "[spoiler=") !== false) and (++$endlessloop < 20)) { + while ((strpos($Text, "[/spoiler]")!== false) && (strpos($Text, "[spoiler=") !== false) && (++$endlessloop < 20)) { $Text = preg_replace("/\[spoiler=[\"\']*(.*?)[\"\']*\](.*?)\[\/spoiler\]/ism", "
" . $t_wrote . "
$2
", $Text); @@ -1148,7 +1148,7 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa // Check for [quote] text // handle nested quotes $endlessloop = 0; - while ((strpos($Text, "[/quote]") !== false) and (strpos($Text, "[quote]") !== false) and (++$endlessloop < 20)) { + while ((strpos($Text, "[/quote]") !== false) && (strpos($Text, "[quote]") !== false) && (++$endlessloop < 20)) { $Text = preg_replace("/\[quote\](.*?)\[\/quote\]/ism", "$QuoteLayout", $Text); } @@ -1158,7 +1158,7 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa // handle nested quotes $endlessloop = 0; - while ((strpos($Text, "[/quote]")!== false) and (strpos($Text, "[quote=") !== false) and (++$endlessloop < 20)) { + while ((strpos($Text, "[/quote]")!== false) && (strpos($Text, "[quote=") !== false) && (++$endlessloop < 20)) { $Text = preg_replace("/\[quote=[\"\']*(.*?)[\"\']*\](.*?)\[\/quote\]/ism", "
" . $t_wrote . "
$2
", $Text); diff --git a/include/dbstructure.php b/include/dbstructure.php index b53befbf29..8ab9bf9d58 100644 --- a/include/dbstructure.php +++ b/include/dbstructure.php @@ -530,7 +530,7 @@ function db_create_table($name, $fields, $verbose, $action, $indexes=null) { $primary_keys = array(); foreach ($fields AS $fieldname => $field) { $sql_rows[] = "`".dbesc($fieldname)."` ".db_field_command($field); - if (x($field,'primary') and $field['primary']!='') { + if (x($field,'primary') && $field['primary']!='') { $primary_keys[] = $fieldname; } } diff --git a/include/delivery.php b/include/delivery.php index 9e6d8ffe61..05fba7985c 100644 --- a/include/delivery.php +++ b/include/delivery.php @@ -91,7 +91,7 @@ function delivery_run(&$argv, &$argc){ $uid = $item_id; } else { // find ancestors - $r = q("SELECT * FROM `item` WHERE `id` = %d and visible = 1 and moderated = 0 LIMIT 1", + $r = q("SELECT * FROM `item` WHERE `id` = %d AND visible = 1 AND moderated = 0 LIMIT 1", intval($item_id) ); @@ -105,7 +105,7 @@ function delivery_run(&$argv, &$argc){ $updated = $r[0]['edited']; $items = q("SELECT `item`.*, `sign`.`signed_text`,`sign`.`signature`,`sign`.`signer` - FROM `item` LEFT JOIN `sign` ON `sign`.`iid` = `item`.`id` WHERE `parent` = %d and visible = 1 and moderated = 0 ORDER BY `id` ASC", + FROM `item` LEFT JOIN `sign` ON `sign`.`iid` = `item`.`id` WHERE `parent` = %d AND visible = 1 AND moderated = 0 ORDER BY `id` ASC", intval($parent_id) ); @@ -453,7 +453,7 @@ function delivery_run(&$argv, &$argc){ $headers .= "References: <".iri2msgid($it["parent-uri"]).">"; // If Threading is enabled, write down the correct parent - if (($it["thr-parent"] != "") and ($it["thr-parent"] != $it["parent-uri"])) + if (($it["thr-parent"] != "") && ($it["thr-parent"] != $it["parent-uri"])) $headers .= " <".iri2msgid($it["thr-parent"]).">"; $headers .= "\n"; diff --git a/include/discover_poco.php b/include/discover_poco.php index 11794c32d7..6bb296c9c1 100644 --- a/include/discover_poco.php +++ b/include/discover_poco.php @@ -83,10 +83,10 @@ function discover_poco_run(&$argv, &$argc) { update_suggestions(); } elseif (($mode == 2) && get_config('system','poco_completion')) { discover_users(); - } elseif (($mode == 1) && ($search != "") and get_config('system','poco_local_search')) { + } elseif (($mode == 1) && ($search != "") && get_config('system','poco_local_search')) { discover_directory($search); gs_search_user($search); - } elseif (($mode == 0) && ($search == "") and (get_config('system','poco_discovery') > 0)) { + } elseif (($mode == 0) && ($search == "") && (get_config('system','poco_discovery') > 0)) { // Query Friendica and Hubzilla servers for their users poco_discover(); diff --git a/include/email.php b/include/email.php index b8d99433e1..78e98a830c 100644 --- a/include/email.php +++ b/include/email.php @@ -152,7 +152,7 @@ function email_get_part($mbox,$uid,$p,$partno, $subtype) { if ($p->parameters) foreach ($p->parameters as $x) $params[strtolower($x->attribute)] = $x->value; - if (isset($p->dparameters) and $p->dparameters) + if (isset($p->dparameters) && $p->dparameters) foreach ($p->dparameters as $x) $params[strtolower($x->attribute)] = $x->value; @@ -160,7 +160,7 @@ function email_get_part($mbox,$uid,$p,$partno, $subtype) { // Any part with a filename is an attachment, // so an attached text file (type 0) is not mistaken as the message. - if ((isset($params['filename']) and $params['filename']) || (isset($params['name']) and $params['name'])) { + if ((isset($params['filename']) && $params['filename']) || (isset($params['name']) && $params['name'])) { // filename may be given as 'Filename' or 'Name' or both $filename = ($params['filename'])? $params['filename'] : $params['name']; // filename may be encoded, so see imap_mime_header_decode() @@ -191,7 +191,7 @@ function email_get_part($mbox,$uid,$p,$partno, $subtype) { // } // SUBPART RECURSION - if (isset($p->parts) and $p->parts) { + if (isset($p->parts) && $p->parts) { $x = ""; foreach ($p->parts as $partno0=>$p2) { $x .= email_get_part($mbox,$uid,$p2,$partno . '.' . ($partno0+1), $subtype); // 1.2, 1.2.1, etc. diff --git a/include/enotify.php b/include/enotify.php index d0fcbeef10..39665d14d4 100644 --- a/include/enotify.php +++ b/include/enotify.php @@ -115,7 +115,7 @@ function notification($params) { dbesc($params['link']), intval($params['uid']) ); - if ($p and count($p)) { + if ($p && count($p)) { pop_lang(); return; } diff --git a/include/html2bbcode.php b/include/html2bbcode.php index 1deab95195..435f6b77c1 100644 --- a/include/html2bbcode.php +++ b/include/html2bbcode.php @@ -44,7 +44,7 @@ function node2bbcodesub(&$doc, $oldnode, $attributes, $startbb, $endbb) if (strpos('*'.$startbb, '$1') > 0) { - if ($replace and (@$attr[$attribute] != '')) { + if ($replace && (@$attr[$attribute] != '')) { $startbb = preg_replace($value, $startbb, $attr[$attribute], -1, $count); diff --git a/include/html2plain.php b/include/html2plain.php index da308a5c69..72185de3b5 100644 --- a/include/html2plain.php +++ b/include/html2plain.php @@ -23,7 +23,7 @@ function breaklines($line, $level, $wraplength = 75) if ($pos == 0) $pos = strpos($line, ' '); - if (($pos > 0) and strlen($line) > $wraplen) { + if (($pos > 0) && strlen($line) > $wraplen) { $newline = trim(substr($line, 0, $pos)); if ($level > 0) $newline = str_repeat(">", $level).' '.$newline; @@ -32,7 +32,7 @@ function breaklines($line, $level, $wraplength = 75) $line = substr($line, $pos+1); } - } while ((strlen($line) > $wraplen) and !($oldline == $line)); + } while ((strlen($line) > $wraplen) && !($oldline == $line)); if ($level > 0) $line = str_repeat(">", $level).' '.$line; @@ -70,7 +70,7 @@ function quotelevel($message, $wraplength = 75) $line = substr($line, 0, $pos).substr($line, $pos+8); } - if (!$startquote or ($line != '')) + if (!$startquote || ($line != '')) $newlines[] = breaklines($line, $currlevel, $wraplength); } return(implode($newlines, "\n")); @@ -92,13 +92,13 @@ function collecturls($message) { if (strpos($treffer[1], $listitem) !== false) $ignore = true; - if ((strpos($treffer[1], "//twitter.com/") !== false) and (strpos($treffer[1], "/status/") !== false)) + if ((strpos($treffer[1], "//twitter.com/") !== false) && (strpos($treffer[1], "/status/") !== false)) $ignore = false; - if ((strpos($treffer[1], "//plus.google.com/") !== false) and (strpos($treffer[1], "/posts") !== false)) + if ((strpos($treffer[1], "//plus.google.com/") !== false) && (strpos($treffer[1], "/posts") !== false)) $ignore = false; - if ((strpos($treffer[1], "//plus.google.com/") !== false) and (strpos($treffer[1], "/photos") !== false)) + if ((strpos($treffer[1], "//plus.google.com/") !== false) && (strpos($treffer[1], "/photos") !== false)) $ignore = false; if (!$ignore) diff --git a/include/items.php b/include/items.php index 234c001942..eb30763909 100644 --- a/include/items.php +++ b/include/items.php @@ -143,7 +143,7 @@ function title_is_body($title, $body) { $body = substr($body, 0, strlen($title)); } - if (($title != $body) and (substr($title, -3) == "...")) { + if (($title != $body) && (substr($title, -3) == "...")) { $pos = strrpos($title, "..."); if ($pos > 0) { $title = substr($title, 0, $pos); @@ -1282,7 +1282,7 @@ function get_item_id($guid, $uid = 0) { // Does the given user have this item? if ($uid) { $r = q("SELECT `item`.`id`, `user`.`nickname` FROM `item` INNER JOIN `user` ON `user`.`uid` = `item`.`uid` - WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0 + WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 AND `item`.`moderated` = 0 AND `item`.`guid` = '%s' AND `item`.`uid` = %d", dbesc($guid), intval($uid)); if (dbm::is_result($r)) { $id = $r[0]["id"]; @@ -1293,7 +1293,7 @@ function get_item_id($guid, $uid = 0) { // Or is it anywhere on the server? if ($nick == "") { $r = q("SELECT `item`.`id`, `user`.`nickname` FROM `item` INNER JOIN `user` ON `user`.`uid` = `item`.`uid` - WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0 + WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 AND `item`.`moderated` = 0 AND `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' AND `item`.`private` = 0 AND `item`.`wall` = 1 diff --git a/include/message.php b/include/message.php index 7a62af8c93..0c1ffff7cf 100644 --- a/include/message.php +++ b/include/message.php @@ -108,7 +108,7 @@ function send_message($recipient=0, $body='', $subject='', $replyto=''){ ); - $r = q("SELECT * FROM `mail` WHERE `uri` = '%s' and `uid` = %d LIMIT 1", + $r = q("SELECT * FROM `mail` WHERE `uri` = '%s' AND `uid` = %d LIMIT 1", dbesc($uri), intval(local_user()) ); diff --git a/include/msgclean.php b/include/msgclean.php index 9e8ebed790..4abbafb71b 100644 --- a/include/msgclean.php +++ b/include/msgclean.php @@ -124,7 +124,7 @@ function removesig($message) // Sollte sich der Signaturtrenner innerhalb eines Quotes befinden // wird keine Signaturtrennung ausgefuehrt - if (($sigpos < $quotepos) and ($sigpos != 0)) + if (($sigpos < $quotepos) && ($sigpos != 0)) return(array('body' => $message, 'sig' => '')); /// @TODO Regexp umstellen, so dass auf 1 oder kein Leerzeichen @@ -135,7 +135,7 @@ function removesig($message) preg_match($pattern, $message, $result); - if (($result[1] != '') and ($result[2] != '')) { + if (($result[1] != '') && ($result[2] != '')) { $cleaned = trim($result[1])."\n"; $sig = trim($result[2]); // '[hr][size=x-small][color=darkblue]'.trim($result[2]).'[/color][/size]'; @@ -157,8 +157,8 @@ function removelinebreak($message) foreach ($arrbody as $i => $line) { $currquotelevel = 0; $currline = $line; - while ((strlen($currline)>0) and ((substr($currline, 0, 1) == '>') - or (substr($currline, 0, 1) == ' '))) { + while ((strlen($currline)>0) && ((substr($currline, 0, 1) == '>') + || (substr($currline, 0, 1) == ' '))) { if (substr($currline, 0, 1) == '>') $currquotelevel++; @@ -167,8 +167,8 @@ function removelinebreak($message) $quotelevel = 0; $nextline = trim($arrbody[$i+1]); - while ((strlen($nextline)>0) and ((substr($nextline, 0, 1) == '>') - or (substr($nextline, 0, 1) == ' '))) { + while ((strlen($nextline)>0) && ((substr($nextline, 0, 1) == '>') + || (substr($nextline, 0, 1) == ' '))) { if (substr($nextline, 0, 1) == '>') $quotelevel++; @@ -178,21 +178,21 @@ function removelinebreak($message) $len = strlen($line); $firstword = strpos($nextline.' ', ' '); - $specialchars = ((substr(trim($nextline), 0, 1) == '-') or - (substr(trim($nextline), 0, 1) == '=') or - (substr(trim($nextline), 0, 1) == '*') or - (substr(trim($nextline), 0, 1) == '·') or - (substr(trim($nextline), 0, 4) == '[url') or - (substr(trim($nextline), 0, 5) == '[size') or - (substr(trim($nextline), 0, 7) == 'http://') or + $specialchars = ((substr(trim($nextline), 0, 1) == '-') || + (substr(trim($nextline), 0, 1) == '=') || + (substr(trim($nextline), 0, 1) == '*') || + (substr(trim($nextline), 0, 1) == '·') || + (substr(trim($nextline), 0, 4) == '[url') || + (substr(trim($nextline), 0, 5) == '[size') || + (substr(trim($nextline), 0, 7) == 'http://') || (substr(trim($nextline), 0, 8) == 'https://')); if (!$specialchars) - $specialchars = ((substr(rtrim($line), -1) == '-') or - (substr(rtrim($line), -1) == '=') or - (substr(rtrim($line), -1) == '*') or - (substr(rtrim($line), -1) == '·') or - (substr(rtrim($line), -6) == '[/url]') or + $specialchars = ((substr(rtrim($line), -1) == '-') || + (substr(rtrim($line), -1) == '=') || + (substr(rtrim($line), -1) == '*') || + (substr(rtrim($line), -1) == '·') || + (substr(rtrim($line), -6) == '[/url]') || (substr(rtrim($line), -7) == '[/size]')); //if ($specialchars) @@ -202,8 +202,8 @@ function removelinebreak($message) if (substr($lines[$lineno], -1) != ' ') $lines[$lineno] .= ' '; - while ((strlen($line)>0) and ((substr($line, 0, 1) == '>') - or (substr($line, 0, 1) == ' '))) { + while ((strlen($line)>0) && ((substr($line, 0, 1) == '>') + || (substr($line, 0, 1) == ' '))) { $line = ltrim(substr($line, 1)); } @@ -213,10 +213,10 @@ function removelinebreak($message) // $lines[$lineno] = $quotelevel.'-'.$len.'-'.$firstword.'-'; $lines[$lineno] .= $line; - //if ((($len + $firstword < 68) and (substr($line, -1, 1) != ' ')) - // or ($quotelevel != $currquotelevel) or $specialchars) + //if ((($len + $firstword < 68) && (substr($line, -1, 1) != ' ')) + // || ($quotelevel != $currquotelevel) || $specialchars) if (((substr($line, -1, 1) != ' ')) - or ($quotelevel != $currquotelevel)) + || ($quotelevel != $currquotelevel)) $lineno++; } return(implode("\n", $lines)); diff --git a/include/notifier.php b/include/notifier.php index 94124fee1f..7f6318182f 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -163,7 +163,7 @@ function notifier_run(&$argv, &$argc){ $recipients_relocate = q("SELECT * FROM contact WHERE uid = %d AND self = 0 AND network = '%s'" , intval($uid), NETWORK_DFRN); } else { // find ancestors - $r = q("SELECT * FROM `item` WHERE `id` = %d and visible = 1 and moderated = 0 LIMIT 1", + $r = q("SELECT * FROM `item` WHERE `id` = %d AND visible = 1 AND moderated = 0 LIMIT 1", intval($item_id) ); @@ -177,7 +177,7 @@ function notifier_run(&$argv, &$argc){ $updated = $r[0]['edited']; $items = q("SELECT `item`.*, `sign`.`signed_text`,`sign`.`signature`,`sign`.`signer` - FROM `item` LEFT JOIN `sign` ON `sign`.`iid` = `item`.`id` WHERE `parent` = %d and visible = 1 and moderated = 0 ORDER BY `id` ASC", + FROM `item` LEFT JOIN `sign` ON `sign`.`iid` = `item`.`id` WHERE `parent` = %d AND visible = 1 AND moderated = 0 ORDER BY `id` ASC", intval($parent_id) ); diff --git a/include/onepoll.php b/include/onepoll.php index bcb9d09be2..28afca28a5 100644 --- a/include/onepoll.php +++ b/include/onepoll.php @@ -69,8 +69,8 @@ function onepoll_run(&$argv, &$argc){ // load current friends if possible. if (($contact['poco'] != "") && ($contact['success_update'] > $contact['failure_update'])) { - $r = q("SELECT count(*) as total from glink - where `cid` = %d and updated > UTC_TIMESTAMP() - INTERVAL 1 DAY", + $r = q("SELECT count(*) AS total FROM glink + WHERE `cid` = %d AND updated > UTC_TIMESTAMP() - INTERVAL 1 DAY", intval($contact['id']) ); if (dbm::is_result($r)) { @@ -467,15 +467,15 @@ function onepoll_run(&$argv, &$argc){ $datarray['created'] = datetime_convert('UTC','UTC',$meta->date); // Is it a reply? - $reply = ((substr(strtolower($datarray['title']), 0, 3) == "re:") or - (substr(strtolower($datarray['title']), 0, 3) == "re-") or + $reply = ((substr(strtolower($datarray['title']), 0, 3) == "re:") || + (substr(strtolower($datarray['title']), 0, 3) == "re-") || ($raw_refs != "")); // Remove Reply-signs in the subject $datarray['title'] = RemoveReply($datarray['title']); // If it seems to be a reply but a header couldn't be found take the last message with matching subject - if (!x($datarray,'parent-uri') and $reply) { + if (!x($datarray,'parent-uri') && $reply) { $r = q("SELECT `uri` , `parent-uri` FROM `item` WHERE `title` = \"%s\" AND `uid` = %d AND `network` = '%s' ORDER BY `created` DESC LIMIT 1", dbesc(protect_sprintf($datarray['title'])), intval($importer_uid), diff --git a/include/photos.php b/include/photos.php index a1faffc259..6e0002bd47 100644 --- a/include/photos.php +++ b/include/photos.php @@ -12,7 +12,7 @@ function getGps($exifCoord, $hemi) { $minutes = count($exifCoord) > 1 ? gps2Num($exifCoord[1]) : 0; $seconds = count($exifCoord) > 2 ? gps2Num($exifCoord[2]) : 0; - $flip = ($hemi == 'W' or $hemi == 'S') ? -1 : 1; + $flip = ($hemi == 'W' || $hemi == 'S') ? -1 : 1; return floatval($flip * ($degrees + ($minutes / 60) + ($seconds / 3600))); } diff --git a/include/quoteconvert.php b/include/quoteconvert.php index 33e8843b0b..71a15350c5 100644 --- a/include/quoteconvert.php +++ b/include/quoteconvert.php @@ -10,7 +10,7 @@ function convertquote($body, $reply) $quoteline = $arrbody[$i]; while ((strlen($quoteline)>0) and ((substr($quoteline, 0, 1) == '>') - or (substr($quoteline, 0, 1) == ' '))) { + || (substr($quoteline, 0, 1) == ' '))) { if (substr($quoteline, 0, 1) == '>') $quotelevel++; diff --git a/include/xml.php b/include/xml.php index a9f4679b48..c184b5099e 100644 --- a/include/xml.php +++ b/include/xml.php @@ -323,7 +323,7 @@ class xml { if ($type == "open") { // The starting of the tag '' $parent[$level-1] = &$current; - if (!is_array($current) or (!in_array($tag, array_keys($current)))) { // Insert New tag + if (!is_array($current) || (!in_array($tag, array_keys($current)))) { // Insert New tag $current[$tag] = $result; if ($attributes_data) { $current[$tag. '_attr'] = $attributes_data; diff --git a/mod/settings.php b/mod/settings.php index 6793d86a9c..e4ac9f0459 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -949,7 +949,7 @@ function settings_content(App $a) { $is_experimental = file_exists('view/theme/' . $th . '/experimental'); $unsupported = file_exists('view/theme/' . $th . '/unsupported'); $is_mobile = file_exists('view/theme/' . $th . '/mobile'); - if (!$is_experimental or ($is_experimental && (get_config('experimentals','exp_themes')==1 or get_config('experimentals','exp_themes')===false))){ + if (!$is_experimental || ($is_experimental && (get_config('experimentals','exp_themes')==1 || get_config('experimentals','exp_themes')===false))){ $theme_name = (($is_experimental) ? sprintf("%s - \x28Experimental\x29", $f) : $f); if ($is_mobile) { $mobile_themes[$f]=$theme_name; diff --git a/util/php2po.php b/util/php2po.php index e07f718004..35bdc94317 100644 --- a/util/php2po.php +++ b/util/php2po.php @@ -93,7 +93,7 @@ print "\nLoading base message.po..."; // load base messages.po and extract msgids $base_msgids = array(); $norm_base_msgids = array(); -$base_f = file("util/messages.po") or die("No base messages.po\n"); +$base_f = file("util/messages.po") || die("No base messages.po\n"); $_f = 0; $_mid = ""; $_mids = array(); foreach( $base_f as $l) { $l = trim($l); diff --git a/util/typo.php b/util/typo.php index 1b84181db3..d837bcefc9 100755 --- a/util/typo.php +++ b/util/typo.php @@ -27,7 +27,7 @@ $Iterator = new RecursiveDirectoryIterator('src'); foreach (new RecursiveIteratorIterator($Iterator) as $file) { if (substr($file, -4) === '.php') { passthru("$phpath -l $file", $ret); - $ret === 0 or die(); + $ret === 0 || die(); } } @@ -35,21 +35,21 @@ echo "Directory: mod\n"; $files = glob('mod/*.php'); foreach ($files as $file) { passthru("$phpath -l $file", $ret); - $ret === 0 or die(); + $ret === 0 || die(); } echo "Directory: include\n"; $files = glob('include/*.php'); foreach ($files as $file) { passthru("$phpath -l $file", $ret); - $ret === 0 or die(); + $ret === 0 || die(); } echo "Directory: object\n"; $files = glob('object/*.php'); foreach ($files as $file) { passthru("$phpath -l $file", $ret); - $ret === 0 or die(); + $ret === 0 || die(); } echo "Directory: addon\n"; @@ -60,7 +60,7 @@ foreach ($dirs as $dir) { $files = glob($dir . '/' . $addon . '.php'); foreach ($files as $file) { passthru("$phpath -l $file", $ret); - $ret === 0 or die(); + $ret === 0 || die(); } } @@ -68,10 +68,10 @@ echo "String files\n"; echo 'util/strings.php' . "\n"; passthru("$phpath -l util/strings.php", $ret); -$ret === 0 or die(); +$ret === 0 || die(); $files = glob('view/lang/*/strings.php'); foreach ($files as $file) { passthru("$phpath -l $file", $ret); - $ret === 0 or die(); + $ret === 0 || die(); } diff --git a/view/theme/vier/theme.php b/view/theme/vier/theme.php index eaee46e928..298f0df57f 100644 --- a/view/theme/vier/theme.php +++ b/view/theme/vier/theme.php @@ -21,7 +21,7 @@ function vier_init(App $a) { set_template_engine($a, 'smarty3'); - if ($a->argv[0].$a->argv[1] === "profile".$a->user['nickname'] or $a->argv[0] === "network" && local_user()) { + if ($a->argv[0].$a->argv[1] === "profile".$a->user['nickname'] || $a->argv[0] === "network" && local_user()) { vier_community_info(); $a->page['htmlhead'] .= "\n";