Replace lowercase operators

This commit is contained in:
Hypolite Petovan 2017-06-08 21:03:44 -04:00
parent 98d1051583
commit ad4cdf2a9d
24 changed files with 80 additions and 80 deletions

View file

@ -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);
}
}

View file

@ -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) {

View file

@ -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

View file

@ -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");

View file

@ -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",
"<br /><strong class=".'"spoiler"'.">" . $t_wrote . "</strong><blockquote class=".'"spoiler"'.">$2</blockquote>",
$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",
"<br /><strong class=".'"author"'.">" . $t_wrote . "</strong><blockquote>$2</blockquote>",
$Text);

View file

@ -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;
}
}

View file

@ -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";

View file

@ -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();

View file

@ -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.

View file

@ -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;
}

View file

@ -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);

View file

@ -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)

View file

@ -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

View file

@ -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())
);

View file

@ -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));

View file

@ -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)
);

View file

@ -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),

View file

@ -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)));
}

View file

@ -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++;

View file

@ -323,7 +323,7 @@ class xml {
if ($type == "open") { // The starting of the tag '<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;

View file

@ -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;

View file

@ -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);

View file

@ -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();
}

View file

@ -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'] .= "<link rel='stylesheet' type='text/css' href='view/theme/vier/wide.css' media='screen and (min-width: 1300px)'/>\n";