Browse Source

Replace lowercase operators

tags/3.5.3
Hypolite Petovan 2 years ago
parent
commit
ad4cdf2a9d

+ 2
- 2
boot.php View File

@@ -1424,10 +1424,10 @@ function clear_cache($basepath = "", $path = "") {
1424 1424
 		if ($dh = opendir($path)) {
1425 1425
 			while (($file = readdir($dh)) !== false) {
1426 1426
 				$fullpath = $path . "/" . $file;
1427
-				if ((filetype($fullpath) == "dir") and ($file != ".") and ($file != "..")) {
1427
+				if ((filetype($fullpath) == "dir") && ($file != ".") && ($file != "..")) {
1428 1428
 					clear_cache($basepath, $fullpath);
1429 1429
 				}
1430
-				if ((filetype($fullpath) == "file") and (filectime($fullpath) < (time() - $cachetime))) {
1430
+				if ((filetype($fullpath) == "file") && (filectime($fullpath) < (time() - $cachetime))) {
1431 1431
 					unlink($fullpath);
1432 1432
 				}
1433 1433
 			}

+ 4
- 4
include/NotificationsManager.php View File

@@ -512,7 +512,7 @@ class NotificationsManager {
512 512
 		$myurl = substr($myurl,strpos($myurl,'://')+3);
513 513
 		$myurl = str_replace(array('www.','.'),array('','\\.'),$myurl);
514 514
 		$diasp_url = str_replace('/profile/','/u/',$myurl);
515
-		$sql_extra = sprintf(" AND ( `item`.`author-link` regexp '%s' or `item`.`tag` regexp '%s' or `item`.`tag` regexp '%s' ) ",
515
+		$sql_extra = sprintf(" AND ( `item`.`author-link` regexp '%s' OR `item`.`tag` regexp '%s' OR `item`.`tag` regexp '%s' ) ",
516 516
 			dbesc($myurl . '$'),
517 517
 			dbesc($myurl . '\\]'),
518 518
 			dbesc($diasp_url . '\\]')
@@ -829,11 +829,11 @@ class NotificationsManager {
829 829
 	}
830 830
 
831 831
 	/**
832
-	 * @brief Check for missing contact data and try to fetch the data from 
832
+	 * @brief Check for missing contact data and try to fetch the data from
833 833
 	 *     from other sources
834
-	 * 
834
+	 *
835 835
 	 * @param array $arr The input array with the intro data
836
-	 * 
836
+	 *
837 837
 	 * @return array The array with the intro data
838 838
 	 */
839 839
 	private function getMissingIntroData($arr) {

+ 4
- 4
include/api.php View File

@@ -2178,7 +2178,7 @@ $called_api = null;
2178 2178
 				`contact`.`id` AS `cid`
2179 2179
 				FROM `item`, `contact`
2180 2180
 				WHERE `item`.`uid` = %d
2181
-				AND `item`.`visible` = 1 and `item`.`moderated` = 0 AND `item`.`deleted` = 0
2181
+				AND `item`.`visible` = 1 AND `item`.`moderated` = 0 AND `item`.`deleted` = 0
2182 2182
 				AND `item`.`starred` = 1
2183 2183
 				AND `contact`.`id` = `item`.`contact-id`
2184 2184
 				AND (NOT `contact`.`blocked` OR `contact`.`pending`)
@@ -2263,13 +2263,13 @@ $called_api = null;
2263 2263
 
2264 2264
 		$statustitle = trim($item['title']);
2265 2265
 
2266
-		if (($statustitle != '') and (strpos($statusbody, $statustitle) !== false)) {
2266
+		if (($statustitle != '') && (strpos($statusbody, $statustitle) !== false)) {
2267 2267
 			$statustext = trim($statusbody);
2268 2268
 		} else {
2269 2269
 			$statustext = trim($statustitle."\n\n".$statusbody);
2270 2270
 		}
2271 2271
 
2272
-		if (($item["network"] == NETWORK_FEED) and (strlen($statustext)> 1000)) {
2272
+		if (($item["network"] == NETWORK_FEED) && (strlen($statustext)> 1000)) {
2273 2273
 			$statustext = substr($statustext, 0, 1000)."... \n".$item["plink"];
2274 2274
 		}
2275 2275
 
@@ -3982,7 +3982,7 @@ $called_api = null;
3982 3982
 	}
3983 3983
 
3984 3984
 	function prepare_photo_data($type, $scale, $photo_id) {
3985
-		$scale_sql = ($scale === false ? "" : sprintf("and scale=%d", intval($scale)));
3985
+		$scale_sql = ($scale === false ? "" : sprintf("AND scale=%d", intval($scale)));
3986 3986
 		$data_sql = ($scale === false ? "" : "data, ");
3987 3987
 
3988 3988
 		// added allow_cid, allow_gid, deny_cid, deny_gid to output as string like stored in database

+ 1
- 1
include/auth_ejabberd.php View File

@@ -89,7 +89,7 @@ class exAuth {
89 89
 
90 90
 		// Open the logfile if the logfile name is defined
91 91
 		if ($this->sLogFile != '')
92
-			$this->rLogFile = fopen($this->sLogFile, "a") or die("Error opening log file: ". $this->sLogFile);
92
+			$this->rLogFile = fopen($this->sLogFile, "a") || die("Error opening log file: ". $this->sLogFile);
93 93
 
94 94
 		$this->writeLog("[exAuth] start");
95 95
 

+ 5
- 5
include/bbcode.php View File

@@ -147,7 +147,7 @@ function cleancss($input) {
147 147
 	for ($i = 0; $i < strlen($input); $i++) {
148 148
 		$char = substr($input, $i, 1);
149 149
 
150
-		if (($char >= "a") and ($char <= "z")) {
150
+		if (($char >= "a") && ($char <= "z")) {
151 151
 			$cleaned .= $char;
152 152
 		}
153 153
 
@@ -1126,7 +1126,7 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa
1126 1126
 	// Check for [spoiler] text
1127 1127
 	// handle nested quotes
1128 1128
 	$endlessloop = 0;
1129
-	while ((strpos($Text, "[/spoiler]") !== false) and (strpos($Text, "[spoiler]") !== false) and (++$endlessloop < 20)) {
1129
+	while ((strpos($Text, "[/spoiler]") !== false) && (strpos($Text, "[spoiler]") !== false) && (++$endlessloop < 20)) {
1130 1130
 		$Text = preg_replace("/\[spoiler\](.*?)\[\/spoiler\]/ism", "$SpoilerLayout", $Text);
1131 1131
 	}
1132 1132
 
@@ -1136,7 +1136,7 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa
1136 1136
 
1137 1137
 	// handle nested quotes
1138 1138
 	$endlessloop = 0;
1139
-	while ((strpos($Text, "[/spoiler]")!== false)  and (strpos($Text, "[spoiler=") !== false) and (++$endlessloop < 20)) {
1139
+	while ((strpos($Text, "[/spoiler]")!== false)  && (strpos($Text, "[spoiler=") !== false) && (++$endlessloop < 20)) {
1140 1140
 		$Text = preg_replace("/\[spoiler=[\"\']*(.*?)[\"\']*\](.*?)\[\/spoiler\]/ism",
1141 1141
 				     "<br /><strong class=".'"spoiler"'.">" . $t_wrote . "</strong><blockquote class=".'"spoiler"'.">$2</blockquote>",
1142 1142
 				     $Text);
@@ -1148,7 +1148,7 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa
1148 1148
 	// Check for [quote] text
1149 1149
 	// handle nested quotes
1150 1150
 	$endlessloop = 0;
1151
-	while ((strpos($Text, "[/quote]") !== false) and (strpos($Text, "[quote]") !== false) and (++$endlessloop < 20)) {
1151
+	while ((strpos($Text, "[/quote]") !== false) && (strpos($Text, "[quote]") !== false) && (++$endlessloop < 20)) {
1152 1152
 		$Text = preg_replace("/\[quote\](.*?)\[\/quote\]/ism", "$QuoteLayout", $Text);
1153 1153
 	}
1154 1154
 
@@ -1158,7 +1158,7 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa
1158 1158
 
1159 1159
 	// handle nested quotes
1160 1160
 	$endlessloop = 0;
1161
-	while ((strpos($Text, "[/quote]")!== false)  and (strpos($Text, "[quote=") !== false) and (++$endlessloop < 20)) {
1161
+	while ((strpos($Text, "[/quote]")!== false)  && (strpos($Text, "[quote=") !== false) && (++$endlessloop < 20)) {
1162 1162
 		$Text = preg_replace("/\[quote=[\"\']*(.*?)[\"\']*\](.*?)\[\/quote\]/ism",
1163 1163
 				     "<br /><strong class=".'"author"'.">" . $t_wrote . "</strong><blockquote>$2</blockquote>",
1164 1164
 				     $Text);

+ 1
- 1
include/dbstructure.php View File

@@ -530,7 +530,7 @@ function db_create_table($name, $fields, $verbose, $action, $indexes=null) {
530 530
 	$primary_keys = array();
531 531
 	foreach ($fields AS $fieldname => $field) {
532 532
 		$sql_rows[] = "`".dbesc($fieldname)."` ".db_field_command($field);
533
-		if (x($field,'primary') and $field['primary']!='') {
533
+		if (x($field,'primary') && $field['primary']!='') {
534 534
 			$primary_keys[] = $fieldname;
535 535
 		}
536 536
 	}

+ 3
- 3
include/delivery.php View File

@@ -91,7 +91,7 @@ function delivery_run(&$argv, &$argc){
91 91
 			$uid = $item_id;
92 92
 		} else {
93 93
 			// find ancestors
94
-			$r = q("SELECT * FROM `item` WHERE `id` = %d and visible = 1 and moderated = 0 LIMIT 1",
94
+			$r = q("SELECT * FROM `item` WHERE `id` = %d AND visible = 1 AND moderated = 0 LIMIT 1",
95 95
 				intval($item_id)
96 96
 			);
97 97
 
@@ -105,7 +105,7 @@ function delivery_run(&$argv, &$argc){
105 105
 			$updated = $r[0]['edited'];
106 106
 
107 107
 			$items = q("SELECT `item`.*, `sign`.`signed_text`,`sign`.`signature`,`sign`.`signer`
108
-				FROM `item` LEFT JOIN `sign` ON `sign`.`iid` = `item`.`id` WHERE `parent` = %d and visible = 1 and moderated = 0 ORDER BY `id` ASC",
108
+				FROM `item` LEFT JOIN `sign` ON `sign`.`iid` = `item`.`id` WHERE `parent` = %d AND visible = 1 AND moderated = 0 ORDER BY `id` ASC",
109 109
 				intval($parent_id)
110 110
 			);
111 111
 
@@ -453,7 +453,7 @@ function delivery_run(&$argv, &$argc){
453 453
 						$headers .= "References: <".iri2msgid($it["parent-uri"]).">";
454 454
 
455 455
 						// If Threading is enabled, write down the correct parent
456
-						if (($it["thr-parent"] != "") and ($it["thr-parent"] != $it["parent-uri"]))
456
+						if (($it["thr-parent"] != "") && ($it["thr-parent"] != $it["parent-uri"]))
457 457
 							$headers .= " <".iri2msgid($it["thr-parent"]).">";
458 458
 						$headers .= "\n";
459 459
 

+ 2
- 2
include/discover_poco.php View File

@@ -83,10 +83,10 @@ function discover_poco_run(&$argv, &$argc) {
83 83
 		update_suggestions();
84 84
 	} elseif (($mode == 2) && get_config('system','poco_completion')) {
85 85
 		discover_users();
86
-	} elseif (($mode == 1) && ($search != "") and get_config('system','poco_local_search')) {
86
+	} elseif (($mode == 1) && ($search != "") && get_config('system','poco_local_search')) {
87 87
 		discover_directory($search);
88 88
 		gs_search_user($search);
89
-	} elseif (($mode == 0) && ($search == "") and (get_config('system','poco_discovery') > 0)) {
89
+	} elseif (($mode == 0) && ($search == "") && (get_config('system','poco_discovery') > 0)) {
90 90
 		// Query Friendica and Hubzilla servers for their users
91 91
 		poco_discover();
92 92
 

+ 3
- 3
include/email.php View File

@@ -152,7 +152,7 @@ function email_get_part($mbox,$uid,$p,$partno, $subtype) {
152 152
 	if ($p->parameters)
153 153
 		foreach ($p->parameters as $x)
154 154
 			$params[strtolower($x->attribute)] = $x->value;
155
-	if (isset($p->dparameters) and $p->dparameters)
155
+	if (isset($p->dparameters) && $p->dparameters)
156 156
 		foreach ($p->dparameters as $x)
157 157
 			$params[strtolower($x->attribute)] = $x->value;
158 158
 
@@ -160,7 +160,7 @@ function email_get_part($mbox,$uid,$p,$partno, $subtype) {
160 160
 	// Any part with a filename is an attachment,
161 161
 	// so an attached text file (type 0) is not mistaken as the message.
162 162
 
163
-	if ((isset($params['filename']) and $params['filename']) || (isset($params['name']) and $params['name'])) {
163
+	if ((isset($params['filename']) && $params['filename']) || (isset($params['name']) && $params['name'])) {
164 164
 		// filename may be given as 'Filename' or 'Name' or both
165 165
 		$filename = ($params['filename'])? $params['filename'] : $params['name'];
166 166
 		// filename may be encoded, so see imap_mime_header_decode()
@@ -191,7 +191,7 @@ function email_get_part($mbox,$uid,$p,$partno, $subtype) {
191 191
 //	}
192 192
 
193 193
 	// SUBPART RECURSION
194
-	if (isset($p->parts) and $p->parts) {
194
+	if (isset($p->parts) && $p->parts) {
195 195
 		$x = "";
196 196
 		foreach ($p->parts as $partno0=>$p2) {
197 197
 			$x .=  email_get_part($mbox,$uid,$p2,$partno . '.' . ($partno0+1), $subtype);  // 1.2, 1.2.1, etc.

+ 1
- 1
include/enotify.php View File

@@ -115,7 +115,7 @@ function notification($params) {
115 115
 			dbesc($params['link']),
116 116
 			intval($params['uid'])
117 117
 		);
118
-		if ($p and count($p)) {
118
+		if ($p && count($p)) {
119 119
 			pop_lang();
120 120
 			return;
121 121
 		}

+ 1
- 1
include/html2bbcode.php View File

@@ -44,7 +44,7 @@ function node2bbcodesub(&$doc, $oldnode, $attributes, $startbb, $endbb)
44 44
 
45 45
 			if (strpos('*'.$startbb, '$1') > 0) {
46 46
 
47
-				if ($replace and (@$attr[$attribute] != '')) {
47
+				if ($replace && (@$attr[$attribute] != '')) {
48 48
 
49 49
 					$startbb = preg_replace($value, $startbb, $attr[$attribute], -1, $count);
50 50
 

+ 6
- 6
include/html2plain.php View File

@@ -23,7 +23,7 @@ function breaklines($line, $level, $wraplength = 75)
23 23
 		if ($pos == 0)
24 24
 			$pos = strpos($line, ' ');
25 25
 
26
-		if (($pos > 0) and strlen($line) > $wraplen) {
26
+		if (($pos > 0) && strlen($line) > $wraplen) {
27 27
 			$newline = trim(substr($line, 0, $pos));
28 28
 			if ($level > 0)
29 29
                 		$newline = str_repeat(">", $level).' '.$newline;
@@ -32,7 +32,7 @@ function breaklines($line, $level, $wraplength = 75)
32 32
 			$line = substr($line, $pos+1);
33 33
 		}
34 34
 
35
-	} while ((strlen($line) > $wraplen) and !($oldline == $line));
35
+	} while ((strlen($line) > $wraplen) && !($oldline == $line));
36 36
 
37 37
 	if ($level > 0)
38 38
 		$line = str_repeat(">", $level).' '.$line;
@@ -70,7 +70,7 @@ function quotelevel($message, $wraplength = 75)
70 70
 			$line = substr($line, 0, $pos).substr($line, $pos+8);
71 71
 		}
72 72
 
73
-		if (!$startquote or ($line != ''))
73
+		if (!$startquote || ($line != ''))
74 74
 			$newlines[] = breaklines($line, $currlevel, $wraplength);
75 75
 	}
76 76
 	return(implode($newlines, "\n"));
@@ -92,13 +92,13 @@ function collecturls($message) {
92 92
 			if (strpos($treffer[1], $listitem) !== false)
93 93
 				$ignore = true;
94 94
 
95
-		if ((strpos($treffer[1], "//twitter.com/") !== false) and (strpos($treffer[1], "/status/") !== false))
95
+		if ((strpos($treffer[1], "//twitter.com/") !== false) && (strpos($treffer[1], "/status/") !== false))
96 96
 				$ignore = false;
97 97
 
98
-		if ((strpos($treffer[1], "//plus.google.com/") !== false) and (strpos($treffer[1], "/posts") !== false))
98
+		if ((strpos($treffer[1], "//plus.google.com/") !== false) && (strpos($treffer[1], "/posts") !== false))
99 99
 				$ignore = false;
100 100
 
101
-		if ((strpos($treffer[1], "//plus.google.com/") !== false) and (strpos($treffer[1], "/photos") !== false))
101
+		if ((strpos($treffer[1], "//plus.google.com/") !== false) && (strpos($treffer[1], "/photos") !== false))
102 102
 				$ignore = false;
103 103
 
104 104
 		if (!$ignore)

+ 3
- 3
include/items.php View File

@@ -143,7 +143,7 @@ function title_is_body($title, $body) {
143 143
 		$body = substr($body, 0, strlen($title));
144 144
 	}
145 145
 
146
-	if (($title != $body) and (substr($title, -3) == "...")) {
146
+	if (($title != $body) && (substr($title, -3) == "...")) {
147 147
 		$pos = strrpos($title, "...");
148 148
 		if ($pos > 0) {
149 149
 			$title = substr($title, 0, $pos);
@@ -1282,7 +1282,7 @@ function get_item_id($guid, $uid = 0) {
1282 1282
 	// Does the given user have this item?
1283 1283
 	if ($uid) {
1284 1284
 		$r = q("SELECT `item`.`id`, `user`.`nickname` FROM `item` INNER JOIN `user` ON `user`.`uid` = `item`.`uid`
1285
-			WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0
1285
+			WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 AND `item`.`moderated` = 0
1286 1286
 				AND `item`.`guid` = '%s' AND `item`.`uid` = %d", dbesc($guid), intval($uid));
1287 1287
 		if (dbm::is_result($r)) {
1288 1288
 			$id = $r[0]["id"];
@@ -1293,7 +1293,7 @@ function get_item_id($guid, $uid = 0) {
1293 1293
 	// Or is it anywhere on the server?
1294 1294
 	if ($nick == "") {
1295 1295
 		$r = q("SELECT `item`.`id`, `user`.`nickname` FROM `item` INNER JOIN `user` ON `user`.`uid` = `item`.`uid`
1296
-			WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0
1296
+			WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 AND `item`.`moderated` = 0
1297 1297
 				AND `item`.`allow_cid` = ''  AND `item`.`allow_gid` = ''
1298 1298
 				AND `item`.`deny_cid`  = '' AND `item`.`deny_gid`  = ''
1299 1299
 				AND `item`.`private` = 0 AND `item`.`wall` = 1

+ 1
- 1
include/message.php View File

@@ -108,7 +108,7 @@ function send_message($recipient=0, $body='', $subject='', $replyto=''){
108 108
 	);
109 109
 
110 110
 
111
-	$r = q("SELECT * FROM `mail` WHERE `uri` = '%s' and `uid` = %d LIMIT 1",
111
+	$r = q("SELECT * FROM `mail` WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
112 112
 		dbesc($uri),
113 113
 		intval(local_user())
114 114
 	);

+ 23
- 23
include/msgclean.php View File

@@ -124,7 +124,7 @@ function removesig($message)
124 124
 
125 125
 	// Sollte sich der Signaturtrenner innerhalb eines Quotes befinden
126 126
 	// wird keine Signaturtrennung ausgefuehrt
127
-	if (($sigpos < $quotepos) and ($sigpos != 0))
127
+	if (($sigpos < $quotepos) && ($sigpos != 0))
128 128
 		return(array('body' => $message, 'sig' => ''));
129 129
 
130 130
 	/// @TODO Regexp umstellen, so dass auf 1 oder kein Leerzeichen
@@ -135,7 +135,7 @@ function removesig($message)
135 135
 
136 136
 	preg_match($pattern, $message, $result);
137 137
 
138
-	if (($result[1] != '') and ($result[2] != '')) {
138
+	if (($result[1] != '') && ($result[2] != '')) {
139 139
 		$cleaned = trim($result[1])."\n";
140 140
 		$sig = trim($result[2]);
141 141
 		//	'[hr][size=x-small][color=darkblue]'.trim($result[2]).'[/color][/size]';
@@ -157,8 +157,8 @@ function removelinebreak($message)
157 157
 	foreach ($arrbody as $i => $line) {
158 158
 		$currquotelevel = 0;
159 159
 		$currline = $line;
160
-		while ((strlen($currline)>0) and ((substr($currline, 0, 1) == '>')
161
- 			or (substr($currline, 0, 1) == ' '))) {
160
+		while ((strlen($currline)>0) && ((substr($currline, 0, 1) == '>')
161
+ 			|| (substr($currline, 0, 1) == ' '))) {
162 162
 			if (substr($currline, 0, 1) == '>')
163 163
 				$currquotelevel++;
164 164
 
@@ -167,8 +167,8 @@ function removelinebreak($message)
167 167
 
168 168
 		$quotelevel = 0;
169 169
 		$nextline = trim($arrbody[$i+1]);
170
-		while ((strlen($nextline)>0) and ((substr($nextline, 0, 1) == '>')
171
- 			or (substr($nextline, 0, 1) == ' '))) {
170
+		while ((strlen($nextline)>0) && ((substr($nextline, 0, 1) == '>')
171
+ 			|| (substr($nextline, 0, 1) == ' '))) {
172 172
 			if (substr($nextline, 0, 1) == '>')
173 173
 				$quotelevel++;
174 174
 
@@ -178,21 +178,21 @@ function removelinebreak($message)
178 178
 		$len = strlen($line);
179 179
 		$firstword = strpos($nextline.' ', ' ');
180 180
 
181
-		$specialchars = ((substr(trim($nextline), 0, 1) == '-') or
182
-				(substr(trim($nextline), 0, 1) == '=') or
183
-				(substr(trim($nextline), 0, 1) == '*') or
184
-				(substr(trim($nextline), 0, 1) == '·') or
185
-				(substr(trim($nextline), 0, 4) == '[url') or
186
-				(substr(trim($nextline), 0, 5) == '[size') or
187
-				(substr(trim($nextline), 0, 7) == 'http://') or
181
+		$specialchars = ((substr(trim($nextline), 0, 1) == '-') ||
182
+				(substr(trim($nextline), 0, 1) == '=') ||
183
+				(substr(trim($nextline), 0, 1) == '*') ||
184
+				(substr(trim($nextline), 0, 1) == '·') ||
185
+				(substr(trim($nextline), 0, 4) == '[url') ||
186
+				(substr(trim($nextline), 0, 5) == '[size') ||
187
+				(substr(trim($nextline), 0, 7) == 'http://') ||
188 188
 				(substr(trim($nextline), 0, 8) == 'https://'));
189 189
 
190 190
 		if (!$specialchars)
191
-			$specialchars = ((substr(rtrim($line), -1) == '-') or
192
-					(substr(rtrim($line), -1) == '=') or
193
-					(substr(rtrim($line), -1) == '*') or
194
-					(substr(rtrim($line), -1) == '·') or
195
-					(substr(rtrim($line), -6) == '[/url]') or
191
+			$specialchars = ((substr(rtrim($line), -1) == '-') ||
192
+					(substr(rtrim($line), -1) == '=') ||
193
+					(substr(rtrim($line), -1) == '*') ||
194
+					(substr(rtrim($line), -1) == '·') ||
195
+					(substr(rtrim($line), -6) == '[/url]') ||
196 196
 					(substr(rtrim($line), -7) == '[/size]'));
197 197
 
198 198
 		//if ($specialchars)
@@ -202,8 +202,8 @@ function removelinebreak($message)
202 202
 			if (substr($lines[$lineno], -1) != ' ')
203 203
 			$lines[$lineno] .= ' ';
204 204
 
205
-			while ((strlen($line)>0) and ((substr($line, 0, 1) == '>')
206
- 			or (substr($line, 0, 1) == ' '))) {
205
+			while ((strlen($line)>0) && ((substr($line, 0, 1) == '>')
206
+ 			|| (substr($line, 0, 1) == ' '))) {
207 207
 
208 208
 				$line = ltrim(substr($line, 1));
209 209
 			}
@@ -213,10 +213,10 @@ function removelinebreak($message)
213 213
 		//	$lines[$lineno] = $quotelevel.'-'.$len.'-'.$firstword.'-';
214 214
 
215 215
 		$lines[$lineno] .= $line;
216
-		//if ((($len + $firstword < 68) and (substr($line, -1, 1) != ' '))
217
-		//	or ($quotelevel != $currquotelevel) or $specialchars)
216
+		//if ((($len + $firstword < 68) && (substr($line, -1, 1) != ' '))
217
+		//	|| ($quotelevel != $currquotelevel) || $specialchars)
218 218
 		if (((substr($line, -1, 1) != ' '))
219
-			or ($quotelevel != $currquotelevel))
219
+			|| ($quotelevel != $currquotelevel))
220 220
 			$lineno++;
221 221
 	}
222 222
 	return(implode("\n", $lines));

+ 2
- 2
include/notifier.php View File

@@ -163,7 +163,7 @@ function notifier_run(&$argv, &$argc){
163 163
 		$recipients_relocate = q("SELECT * FROM contact WHERE uid = %d  AND self = 0 AND network = '%s'" , intval($uid), NETWORK_DFRN);
164 164
 	} else {
165 165
 		// find ancestors
166
-		$r = q("SELECT * FROM `item` WHERE `id` = %d and visible = 1 and moderated = 0 LIMIT 1",
166
+		$r = q("SELECT * FROM `item` WHERE `id` = %d AND visible = 1 AND moderated = 0 LIMIT 1",
167 167
 			intval($item_id)
168 168
 		);
169 169
 
@@ -177,7 +177,7 @@ function notifier_run(&$argv, &$argc){
177 177
 		$updated = $r[0]['edited'];
178 178
 
179 179
 		$items = q("SELECT `item`.*, `sign`.`signed_text`,`sign`.`signature`,`sign`.`signer`
180
-			FROM `item` LEFT JOIN `sign` ON `sign`.`iid` = `item`.`id` WHERE `parent` = %d and visible = 1 and moderated = 0 ORDER BY `id` ASC",
180
+			FROM `item` LEFT JOIN `sign` ON `sign`.`iid` = `item`.`id` WHERE `parent` = %d AND visible = 1 AND moderated = 0 ORDER BY `id` ASC",
181 181
 			intval($parent_id)
182 182
 		);
183 183
 

+ 5
- 5
include/onepoll.php View File

@@ -69,8 +69,8 @@ function onepoll_run(&$argv, &$argc){
69 69
 
70 70
 	// load current friends if possible.
71 71
 	if (($contact['poco'] != "") && ($contact['success_update'] > $contact['failure_update'])) {
72
-		$r = q("SELECT count(*) as total from glink
73
-			where `cid` = %d and updated > UTC_TIMESTAMP() - INTERVAL 1 DAY",
72
+		$r = q("SELECT count(*) AS total FROM glink
73
+			WHERE `cid` = %d AND updated > UTC_TIMESTAMP() - INTERVAL 1 DAY",
74 74
 			intval($contact['id'])
75 75
 		);
76 76
 		if (dbm::is_result($r)) {
@@ -467,15 +467,15 @@ function onepoll_run(&$argv, &$argc){
467 467
 						$datarray['created'] = datetime_convert('UTC','UTC',$meta->date);
468 468
 
469 469
 						// Is it a reply?
470
-						$reply = ((substr(strtolower($datarray['title']), 0, 3) == "re:") or
471
-							(substr(strtolower($datarray['title']), 0, 3) == "re-") or
470
+						$reply = ((substr(strtolower($datarray['title']), 0, 3) == "re:") ||
471
+							(substr(strtolower($datarray['title']), 0, 3) == "re-") ||
472 472
 							($raw_refs != ""));
473 473
 
474 474
 						// Remove Reply-signs in the subject
475 475
 						$datarray['title'] = RemoveReply($datarray['title']);
476 476
 
477 477
 						// If it seems to be a reply but a header couldn't be found take the last message with matching subject
478
-						if (!x($datarray,'parent-uri') and $reply) {
478
+						if (!x($datarray,'parent-uri') && $reply) {
479 479
 							$r = q("SELECT `uri` , `parent-uri` FROM `item` WHERE `title` = \"%s\" AND `uid` = %d AND `network` = '%s' ORDER BY `created` DESC LIMIT 1",
480 480
 								dbesc(protect_sprintf($datarray['title'])),
481 481
 								intval($importer_uid),

+ 1
- 1
include/photos.php View File

@@ -12,7 +12,7 @@ function getGps($exifCoord, $hemi) {
12 12
 	$minutes = count($exifCoord) > 1 ? gps2Num($exifCoord[1]) : 0;
13 13
 	$seconds = count($exifCoord) > 2 ? gps2Num($exifCoord[2]) : 0;
14 14
 
15
-	$flip = ($hemi == 'W' or $hemi == 'S') ? -1 : 1;
15
+	$flip = ($hemi == 'W' || $hemi == 'S') ? -1 : 1;
16 16
 
17 17
 	return floatval($flip * ($degrees + ($minutes / 60) + ($seconds / 3600)));
18 18
 }

+ 1
- 1
include/quoteconvert.php View File

@@ -10,7 +10,7 @@ function convertquote($body, $reply)
10 10
 		$quoteline = $arrbody[$i];
11 11
 
12 12
 		while ((strlen($quoteline)>0) and ((substr($quoteline, 0, 1) == '>')
13
-			or (substr($quoteline, 0, 1) == ' '))) {
13
+			|| (substr($quoteline, 0, 1) == ' '))) {
14 14
 			if (substr($quoteline, 0, 1) == '>')
15 15
 				$quotelevel++;
16 16
 

+ 1
- 1
include/xml.php View File

@@ -323,7 +323,7 @@ class xml {
323 323
 
324 324
 			if ($type == "open") {   // The starting of the tag '<tag>'
325 325
 				$parent[$level-1] = &$current;
326
-				if (!is_array($current) or (!in_array($tag, array_keys($current)))) { // Insert New tag
326
+				if (!is_array($current) || (!in_array($tag, array_keys($current)))) { // Insert New tag
327 327
 					$current[$tag] = $result;
328 328
 					if ($attributes_data) {
329 329
 						$current[$tag. '_attr'] = $attributes_data;

+ 1
- 1
mod/settings.php View File

@@ -949,7 +949,7 @@ function settings_content(App $a) {
949 949
 				$is_experimental = file_exists('view/theme/' . $th . '/experimental');
950 950
 				$unsupported = file_exists('view/theme/' . $th . '/unsupported');
951 951
 				$is_mobile = file_exists('view/theme/' . $th . '/mobile');
952
-				if (!$is_experimental or ($is_experimental && (get_config('experimentals','exp_themes')==1 or get_config('experimentals','exp_themes')===false))){
952
+				if (!$is_experimental || ($is_experimental && (get_config('experimentals','exp_themes')==1 || get_config('experimentals','exp_themes')===false))){
953 953
 					$theme_name = (($is_experimental) ?  sprintf("%s - \x28Experimental\x29", $f) : $f);
954 954
 					if ($is_mobile) {
955 955
 						$mobile_themes[$f]=$theme_name;

+ 1
- 1
util/php2po.php View File

@@ -93,7 +93,7 @@ print "\nLoading base message.po...";
93 93
 // load base messages.po and extract msgids
94 94
 $base_msgids = array();
95 95
 $norm_base_msgids = array();
96
-$base_f = file("util/messages.po") or die("No base messages.po\n");
96
+$base_f = file("util/messages.po") || die("No base messages.po\n");
97 97
 $_f = 0; $_mid = ""; $_mids = array();
98 98
 foreach( $base_f as $l) {
99 99
 	$l = trim($l);

+ 7
- 7
util/typo.php View File

@@ -27,7 +27,7 @@ $Iterator = new RecursiveDirectoryIterator('src');
27 27
 foreach (new RecursiveIteratorIterator($Iterator) as $file) {
28 28
 	if (substr($file, -4) === '.php') {
29 29
 		passthru("$phpath -l $file", $ret);
30
-		$ret === 0 or die();
30
+		$ret === 0 || die();
31 31
 	}
32 32
 }
33 33
 
@@ -35,21 +35,21 @@ echo "Directory: mod\n";
35 35
 $files = glob('mod/*.php');
36 36
 foreach ($files as $file) {
37 37
 	passthru("$phpath -l $file", $ret);
38
-	$ret === 0 or die();
38
+	$ret === 0 || die();
39 39
 }
40 40
 
41 41
 echo "Directory: include\n";
42 42
 $files = glob('include/*.php');
43 43
 foreach ($files as $file) {
44 44
 	passthru("$phpath -l $file", $ret);
45
-	$ret === 0 or die();
45
+	$ret === 0 || die();
46 46
 }
47 47
 
48 48
 echo "Directory: object\n";
49 49
 $files = glob('object/*.php');
50 50
 foreach ($files as $file) {
51 51
 	passthru("$phpath -l $file", $ret);
52
-	$ret === 0 or die();
52
+	$ret === 0 || die();
53 53
 }
54 54
 
55 55
 echo "Directory: addon\n";
@@ -60,7 +60,7 @@ foreach ($dirs as $dir) {
60 60
 	$files = glob($dir . '/' . $addon . '.php');
61 61
 	foreach ($files as $file) {
62 62
 		passthru("$phpath -l $file", $ret);
63
-		$ret === 0 or die();
63
+		$ret === 0 || die();
64 64
 	}
65 65
 }
66 66
 
@@ -68,10 +68,10 @@ echo "String files\n";
68 68
 
69 69
 echo 'util/strings.php' . "\n";
70 70
 passthru("$phpath -l util/strings.php", $ret);
71
-$ret === 0 or die();
71
+$ret === 0 || die();
72 72
 
73 73
 $files = glob('view/lang/*/strings.php');
74 74
 foreach ($files as $file) {
75 75
 	passthru("$phpath -l $file", $ret);
76
-	$ret === 0 or die();
76
+	$ret === 0 || die();
77 77
 }

+ 1
- 1
view/theme/vier/theme.php View File

@@ -21,7 +21,7 @@ function vier_init(App $a) {
21 21
 
22 22
 	set_template_engine($a, 'smarty3');
23 23
 
24
-	if ($a->argv[0].$a->argv[1] === "profile".$a->user['nickname'] or $a->argv[0] === "network" && local_user()) {
24
+	if ($a->argv[0].$a->argv[1] === "profile".$a->user['nickname'] || $a->argv[0] === "network" && local_user()) {
25 25
 		vier_community_info();
26 26
 
27 27
 		$a->page['htmlhead'] .= "<link rel='stylesheet' type='text/css' href='view/theme/vier/wide.css' media='screen and (min-width: 1300px)'/>\n";

Loading…
Cancel
Save