Passed
Pull Request — master (#5)
by Cody
03:17
created
include/colors.php 2 patches
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 ### HSL >> RGB
184 184
 function _color_hsl2rgb($hsl) {
185 185
     $h = $hsl[0]; $s = $hsl[1]; $l = $hsl[2];
186
-    $m2 = ($l <= 0.5) ? $l * ($s + 1) : $l + $s - $l*$s;
186
+    $m2 = ($l <= 0.5) ? $l * ($s + 1) : $l + $s - $l * $s;
187 187
     $m1 = $l * 2 - $m2;
188 188
     return array(_color_hue2rgb($m1, $m2, $h + 0.33333),
189 189
         _color_hue2rgb($m1, $m2, $h),
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
         $hex = substr($hex, 1);
209 209
 
210 210
     if (strlen($hex) == 4) {
211
-        $hex = $hex[1] . $hex[1] . $hex[2] . $hex[2] . $hex[3] . $hex[3];
211
+        $hex = $hex[1].$hex[1].$hex[2].$hex[2].$hex[3].$hex[3];
212 212
     }
213 213
     $c = hexdec($hex);
214 214
     for ($i = 16; $i >= 0; $i -= 8) {
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 function _color_pack($rgb, $normalize = false) {
221 221
     foreach ($rgb as $k => $v) {
222 222
         $out |= (($v * ($normalize ? 255 : 1)) << (16 - $k * 8));
223
-    }return '#'. str_pad(dechex($out), 6, 0, STR_PAD_LEFT);
223
+    }return '#'.str_pad(dechex($out), 6, 0, STR_PAD_LEFT);
224 224
 }
225 225
 
226 226
 function rgb2hsl($arr) {
@@ -244,13 +244,13 @@  discard block
 block discarded – undo
244 244
     } else {
245 245
         $s = $del_Max / $var_Max;
246 246
 
247
-        $del_R = ((($var_Max - $var_R ) / 6 ) + ($del_Max / 2 ) ) / $del_Max;
248
-        $del_G = ((($var_Max - $var_G ) / 6 ) + ($del_Max / 2 ) ) / $del_Max;
249
-        $del_B = ((($var_Max - $var_B ) / 6 ) + ($del_Max / 2 ) ) / $del_Max;
247
+        $del_R = ((($var_Max - $var_R) / 6) + ($del_Max / 2)) / $del_Max;
248
+        $del_G = ((($var_Max - $var_G) / 6) + ($del_Max / 2)) / $del_Max;
249
+        $del_B = ((($var_Max - $var_B) / 6) + ($del_Max / 2)) / $del_Max;
250 250
 
251
-        if      ($var_R == $var_Max) $h = $del_B - $del_G;
252
-        else if ($var_G == $var_Max) $h = (1 / 3 ) + $del_R - $del_B;
253
-        else if ($var_B == $var_Max) $h = (2 / 3 ) + $del_G - $del_R;
251
+        if ($var_R == $var_Max) $h = $del_B - $del_G;
252
+        else if ($var_G == $var_Max) $h = (1 / 3) + $del_R - $del_B;
253
+        else if ($var_B == $var_Max) $h = (2 / 3) + $del_G - $del_R;
254 254
 
255 255
         if ($h < 0) $h++;
256 256
         if ($h > 1) $h--;
@@ -264,21 +264,21 @@  discard block
 block discarded – undo
264 264
     $s = $arr[1];
265 265
     $v = $arr[2];
266 266
 
267
-    if($s == 0) {
267
+    if ($s == 0) {
268 268
         $r = $g = $B = $v * 255;
269 269
     } else {
270 270
         $var_H = $h * 6;
271
-        $var_i = floor($var_H );
272
-        $var_1 = $v * (1 - $s );
273
-        $var_2 = $v * (1 - $s * ($var_H - $var_i ) );
274
-        $var_3 = $v * (1 - $s * (1 - ($var_H - $var_i ) ) );
275
-
276
-        if       ($var_i == 0) { $var_R = $v     ; $var_G = $var_3  ; $var_B = $var_1 ; }
277
-        else if  ($var_i == 1) { $var_R = $var_2 ; $var_G = $v      ; $var_B = $var_1 ; }
278
-        else if  ($var_i == 2) { $var_R = $var_1 ; $var_G = $v      ; $var_B = $var_3 ; }
279
-        else if  ($var_i == 3) { $var_R = $var_1 ; $var_G = $var_2  ; $var_B = $v     ; }
280
-        else if  ($var_i == 4) { $var_R = $var_3 ; $var_G = $var_1  ; $var_B = $v     ; }
281
-        else                   { $var_R = $v     ; $var_G = $var_1  ; $var_B = $var_2 ; }
271
+        $var_i = floor($var_H);
272
+        $var_1 = $v * (1 - $s);
273
+        $var_2 = $v * (1 - $s * ($var_H - $var_i));
274
+        $var_3 = $v * (1 - $s * (1 - ($var_H - $var_i)));
275
+
276
+        if ($var_i == 0) { $var_R = $v; $var_G = $var_3; $var_B = $var_1; }
277
+        else if ($var_i == 1) { $var_R = $var_2; $var_G = $v; $var_B = $var_1; }
278
+        else if ($var_i == 2) { $var_R = $var_1; $var_G = $v; $var_B = $var_3; }
279
+        else if ($var_i == 3) { $var_R = $var_1; $var_G = $var_2; $var_B = $v; }
280
+        else if ($var_i == 4) { $var_R = $var_3; $var_G = $var_1; $var_B = $v; }
281
+        else { $var_R = $v; $var_G = $var_1; $var_B = $var_2; }
282 282
 
283 283
         $r = $var_R * 255;
284 284
         $g = $var_G * 255;
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 }
289 289
 
290 290
 function colorPalette($imageFile, $numColors, $granularity = 5) {
291
-    $granularity = max(1, abs((int)$granularity));
291
+    $granularity = max(1, abs((int) $granularity));
292 292
     $colors = array();
293 293
 
294 294
     $size = @getimagesize($imageFile);
@@ -301,10 +301,10 @@  discard block
 block discarded – undo
301 301
             $ico = new floIcon();
302 302
             @$ico->readICO($imageFile);
303 303
 
304
-            if(count($ico->images)==0)
304
+            if (count($ico->images) == 0)
305 305
                 return false;
306 306
             else
307
-                $img = @$ico->images[count($ico->images)-1]->getImageResource();
307
+                $img = @$ico->images[count($ico->images) - 1]->getImageResource();
308 308
 
309 309
         } else {
310 310
             return false;
@@ -316,17 +316,17 @@  discard block
 block discarded – undo
316 316
 
317 317
     if (!$img) return false;
318 318
 
319
-    for($x = 0; $x < $size[0]; $x += $granularity) {
320
-        for($y = 0; $y < $size[1]; $y += $granularity) {
319
+    for ($x = 0; $x < $size[0]; $x += $granularity) {
320
+        for ($y = 0; $y < $size[1]; $y += $granularity) {
321 321
             $thisColor = imagecolorat($img, $x, $y);
322 322
             $rgb = imagecolorsforindex($img, $thisColor);
323 323
             $red = round(round(($rgb['red'] / 0x33)) * 0x33);
324 324
             $green = round(round(($rgb['green'] / 0x33)) * 0x33);
325 325
             $blue = round(round(($rgb['blue'] / 0x33)) * 0x33);
326 326
             $thisRGB = sprintf('%02X%02X%02X', $red, $green, $blue);
327
-            if(array_key_exists($thisRGB, $colors)) {
327
+            if (array_key_exists($thisRGB, $colors)) {
328 328
                 $colors[$thisRGB]++;
329
-            } else{
329
+            } else {
330 330
                 $colors[$thisRGB] = 1;
331 331
             }
332 332
         }
Please login to merge, or discard this patch.
Braces   +51 added lines, -31 removed lines patch added patch discarded remove patch
@@ -157,11 +157,12 @@  discard block
 block discarded – undo
157 157
 
158 158
     $color = strtolower($color);
159 159
 
160
-    if (isset($htmlcolors[$color]))
161
-        return $htmlcolors[$color];
162
-    else
163
-        return $color;
164
-}
160
+    if (isset($htmlcolors[$color])) {
161
+            return $htmlcolors[$color];
162
+    } else {
163
+            return $color;
164
+    }
165
+    }
165 166
 
166 167
 ### RGB >> HSL
167 168
 function _color_rgb2hsl($rgb) {
@@ -173,9 +174,15 @@  discard block
 block discarded – undo
173 174
     }
174 175
     $h = 0;
175 176
     if ($delta > 0) {
176
-        if ($max == $r && $max != $g) $h += ($g - $b) / $delta;
177
-        if ($max == $g && $max != $b) $h += (2 + ($b - $r) / $delta);
178
-        if ($max == $b && $max != $r) $h += (4 + ($r - $g) / $delta);
177
+        if ($max == $r && $max != $g) {
178
+            $h += ($g - $b) / $delta;
179
+        }
180
+        if ($max == $g && $max != $b) {
181
+            $h += (2 + ($b - $r) / $delta);
182
+        }
183
+        if ($max == $b && $max != $r) {
184
+            $h += (4 + ($r - $g) / $delta);
185
+        }
179 186
         $h /= 6;
180 187
     } return array($h, $s, $l);
181 188
 }
@@ -193,19 +200,26 @@  discard block
 block discarded – undo
193 200
 ### Helper function for _color_hsl2rgb().
194 201
 function _color_hue2rgb($m1, $m2, $h) {
195 202
     $h = ($h < 0) ? $h + 1 : (($h > 1) ? $h - 1 : $h);
196
-    if ($h * 6 < 1) return $m1 + ($m2 - $m1) * $h * 6;
197
-    if ($h * 2 < 1) return $m2;
198
-    if ($h * 3 < 2) return $m1 + ($m2 - $m1) * (0.66666 - $h) * 6;
203
+    if ($h * 6 < 1) {
204
+        return $m1 + ($m2 - $m1) * $h * 6;
205
+    }
206
+    if ($h * 2 < 1) {
207
+        return $m2;
208
+    }
209
+    if ($h * 3 < 2) {
210
+        return $m1 + ($m2 - $m1) * (0.66666 - $h) * 6;
211
+    }
199 212
     return $m1;
200 213
 }
201 214
 
202 215
 ### Convert a hex color into an RGB triplet.
203 216
 function _color_unpack($hex, $normalize = false) {
204 217
 
205
-    if (strpos($hex, '#') !== 0)
206
-        $hex = _resolve_htmlcolor($hex);
207
-    else
208
-        $hex = substr($hex, 1);
218
+    if (strpos($hex, '#') !== 0) {
219
+            $hex = _resolve_htmlcolor($hex);
220
+    } else {
221
+            $hex = substr($hex, 1);
222
+    }
209 223
 
210 224
     if (strlen($hex) == 4) {
211 225
         $hex = $hex[1] . $hex[1] . $hex[2] . $hex[2] . $hex[3] . $hex[3];
@@ -248,12 +262,20 @@  discard block
 block discarded – undo
248 262
         $del_G = ((($var_Max - $var_G ) / 6 ) + ($del_Max / 2 ) ) / $del_Max;
249 263
         $del_B = ((($var_Max - $var_B ) / 6 ) + ($del_Max / 2 ) ) / $del_Max;
250 264
 
251
-        if      ($var_R == $var_Max) $h = $del_B - $del_G;
252
-        else if ($var_G == $var_Max) $h = (1 / 3 ) + $del_R - $del_B;
253
-        else if ($var_B == $var_Max) $h = (2 / 3 ) + $del_G - $del_R;
265
+        if      ($var_R == $var_Max) {
266
+            $h = $del_B - $del_G;
267
+        } else if ($var_G == $var_Max) {
268
+            $h = (1 / 3 ) + $del_R - $del_B;
269
+        } else if ($var_B == $var_Max) {
270
+            $h = (2 / 3 ) + $del_G - $del_R;
271
+        }
254 272
 
255
-        if ($h < 0) $h++;
256
-        if ($h > 1) $h--;
273
+        if ($h < 0) {
274
+            $h++;
275
+        }
276
+        if ($h > 1) {
277
+            $h--;
278
+        }
257 279
     }
258 280
 
259 281
     return array($h, $s, $v);
@@ -273,12 +295,7 @@  discard block
 block discarded – undo
273 295
         $var_2 = $v * (1 - $s * ($var_H - $var_i ) );
274 296
         $var_3 = $v * (1 - $s * (1 - ($var_H - $var_i ) ) );
275 297
 
276
-        if       ($var_i == 0) { $var_R = $v     ; $var_G = $var_3  ; $var_B = $var_1 ; }
277
-        else if  ($var_i == 1) { $var_R = $var_2 ; $var_G = $v      ; $var_B = $var_1 ; }
278
-        else if  ($var_i == 2) { $var_R = $var_1 ; $var_G = $v      ; $var_B = $var_3 ; }
279
-        else if  ($var_i == 3) { $var_R = $var_1 ; $var_G = $var_2  ; $var_B = $v     ; }
280
-        else if  ($var_i == 4) { $var_R = $var_3 ; $var_G = $var_1  ; $var_B = $v     ; }
281
-        else                   { $var_R = $v     ; $var_G = $var_1  ; $var_B = $var_2 ; }
298
+        if       ($var_i == 0) { $var_R = $v     ; $var_G = $var_3  ; $var_B = $var_1 ; } else if  ($var_i == 1) { $var_R = $var_2 ; $var_G = $v      ; $var_B = $var_1 ; } else if  ($var_i == 2) { $var_R = $var_1 ; $var_G = $v      ; $var_B = $var_3 ; } else if  ($var_i == 3) { $var_R = $var_1 ; $var_G = $var_2  ; $var_B = $v     ; } else if  ($var_i == 4) { $var_R = $var_3 ; $var_G = $var_1  ; $var_B = $v     ; } else                   { $var_R = $v     ; $var_G = $var_1  ; $var_B = $var_2 ; }
282 299
 
283 300
         $r = $var_R * 255;
284 301
         $g = $var_G * 255;
@@ -301,10 +318,11 @@  discard block
 block discarded – undo
301 318
             $ico = new floIcon();
302 319
             @$ico->readICO($imageFile);
303 320
 
304
-            if(count($ico->images)==0)
305
-                return false;
306
-            else
307
-                $img = @$ico->images[count($ico->images)-1]->getImageResource();
321
+            if(count($ico->images)==0) {
322
+                            return false;
323
+            } else {
324
+                            $img = @$ico->images[count($ico->images)-1]->getImageResource();
325
+            }
308 326
 
309 327
         } else {
310 328
             return false;
@@ -314,7 +332,9 @@  discard block
 block discarded – undo
314 332
         $img = @imagecreatefromstring(file_get_contents($imageFile));
315 333
     }
316 334
 
317
-    if (!$img) return false;
335
+    if (!$img) {
336
+        return false;
337
+    }
318 338
 
319 339
     for($x = 0; $x < $size[0]; $x += $granularity) {
320 340
         for($y = 0; $y < $size[1]; $y += $granularity) {
Please login to merge, or discard this patch.
include/functions.php 4 patches
Spacing   +53 added lines, -54 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 define('LABEL_BASE_INDEX', -1024);
6 6
 define('PLUGIN_FEED_BASE_INDEX', -128);
7 7
 
8
-define('COOKIE_LIFETIME_LONG', 86400*365);
8
+define('COOKIE_LIFETIME_LONG', 86400 * 365);
9 9
 
10 10
 $fetch_last_error = false;
11 11
 $fetch_last_error_code = false;
@@ -57,13 +57,13 @@  discard block
 block discarded – undo
57 57
 // feed limit for one update batch
58 58
 define_default('DAEMON_SLEEP_INTERVAL', 120);
59 59
 // default sleep interval between feed updates (sec)
60
-define_default('MAX_CACHE_FILE_SIZE', 64*1024*1024);
60
+define_default('MAX_CACHE_FILE_SIZE', 64 * 1024 * 1024);
61 61
 // do not cache files larger than that (bytes)
62
-define_default('MAX_DOWNLOAD_FILE_SIZE', 16*1024*1024);
62
+define_default('MAX_DOWNLOAD_FILE_SIZE', 16 * 1024 * 1024);
63 63
 // do not download general files larger than that (bytes)
64 64
 define_default('CACHE_MAX_DAYS', 7);
65 65
 // max age in days for various automatically cached (temporary) files
66
-define_default('MAX_CONDITIONAL_INTERVAL', 3600*12);
66
+define_default('MAX_CONDITIONAL_INTERVAL', 3600 * 12);
67 67
 // max interval between forced unconditional updates for servers
68 68
 // not complying with http if-modified-since (seconds)
69 69
 define_default('MAX_FETCH_REQUESTS_PER_HOST', 25);
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 require_once 'db-prefs.php';
158 158
 require_once 'controls.php';
159 159
 
160
-define('SELF_USER_AGENT', 'Tiny Tiny RSS/' . get_version() . ' (http://tt-rss.org/)');
160
+define('SELF_USER_AGENT', 'Tiny Tiny RSS/'.get_version().' (http://tt-rss.org/)');
161 161
 ini_set('user_agent', SELF_USER_AGENT);
162 162
 
163 163
 $schema_version = false;
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
     if (!is_array($options)) {
202 202
 
203 203
         // falling back on compatibility shim
204
-        $option_names = [ "url", "type", "login", "pass", "post_query", "timeout", "last_modified", "useragent" ];
204
+        $option_names = ["url", "type", "login", "pass", "post_query", "timeout", "last_modified", "useragent"];
205 205
         $tmp = [];
206 206
 
207 207
         for ($i = 0; $i < func_num_args(); $i++) {
@@ -228,13 +228,13 @@  discard block
 block discarded – undo
228 228
     $url = str_replace(' ', '%20', $url);
229 229
 
230 230
     if (strpos($url, "//") === 0)
231
-        $url = 'http:' . $url;
231
+        $url = 'http:'.$url;
232 232
 
233 233
     $url_host = parse_url($url, PHP_URL_HOST);
234 234
     $fetch_domain_hits[$url_host] += 1;
235 235
 
236 236
     if ($fetch_domain_hits[$url_host] > MAX_FETCH_REQUESTS_PER_HOST) {
237
-        user_error("Exceeded fetch request quota for $url_host: " . $fetch_domain_hits[$url_host], E_USER_WARNING);
237
+        user_error("Exceeded fetch request quota for $url_host: ".$fetch_domain_hits[$url_host], E_USER_WARNING);
238 238
         #return false;
239 239
     }
240 240
 
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
             array_push($curl_http_headers, "If-Modified-Since: $last_modified");
251 251
 
252 252
         if ($http_accept)
253
-            array_push($curl_http_headers, "Accept: " . $http_accept);
253
+            array_push($curl_http_headers, "Accept: ".$http_accept);
254 254
 
255 255
         if (count($curl_http_headers) > 0)
256 256
             curl_setopt($ch, CURLOPT_HTTPHEADER, $curl_http_headers);
@@ -263,11 +263,10 @@  discard block
 block discarded – undo
263 263
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
264 264
         curl_setopt($ch, CURLOPT_HEADER, true);
265 265
         curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
266
-        curl_setopt($ch, CURLOPT_USERAGENT, $useragent ? $useragent :
267
-            SELF_USER_AGENT);
266
+        curl_setopt($ch, CURLOPT_USERAGENT, $useragent ? $useragent : SELF_USER_AGENT);
268 267
         curl_setopt($ch, CURLOPT_ENCODING, "");
269 268
 
270
-        if  ($http_referrer)
269
+        if ($http_referrer)
271 270
             curl_setopt($ch, CURLOPT_REFERER, $http_referrer);
272 271
 
273 272
         if ($max_size) {
@@ -276,7 +275,7 @@  discard block
 block discarded – undo
276 275
 
277 276
             // holy shit closures in php
278 277
             // download & upload are *expected* sizes respectively, could be zero
279
-            curl_setopt($ch, CURLOPT_PROGRESSFUNCTION, function($curl_handle, $download_size, $downloaded, $upload_size, $uploaded) use( &$max_size) {
278
+            curl_setopt($ch, CURLOPT_PROGRESSFUNCTION, function($curl_handle, $download_size, $downloaded, $upload_size, $uploaded) use(&$max_size) {
280 279
                 Debug::log("[curl progressfunction] $downloaded $max_size", Debug::$LOG_EXTENDED);
281 280
 
282 281
                 return ($downloaded > $max_size) ? 1 : 0; // if max size is set, abort when exceeding it
@@ -336,7 +335,7 @@  discard block
 block discarded – undo
336 335
         if ($http_code != 200 || $type && strpos($fetch_last_content_type, "$type") === false) {
337 336
 
338 337
             if (curl_errno($ch) != 0) {
339
-                $fetch_last_error .=  "; " . curl_errno($ch) . " " . curl_error($ch);
338
+                $fetch_last_error .= "; ".curl_errno($ch)." ".curl_error($ch);
340 339
             }
341 340
 
342 341
             $fetch_last_error_content = $contents;
@@ -345,7 +344,7 @@  discard block
 block discarded – undo
345 344
         }
346 345
 
347 346
         if (!$contents) {
348
-            $fetch_last_error = curl_errno($ch) . " " . curl_error($ch);
347
+            $fetch_last_error = curl_errno($ch)." ".curl_error($ch);
349 348
             curl_close($ch);
350 349
             return false;
351 350
         }
@@ -365,7 +364,7 @@  discard block
 block discarded – undo
365 364
 
366 365
         $fetch_curl_used = false;
367 366
 
368
-        if ($login && $pass){
367
+        if ($login && $pass) {
369 368
             $url_parts = array();
370 369
 
371 370
             preg_match("/(^[^:]*):\/\/(.*)/", $url, $url_parts);
@@ -373,7 +372,7 @@  discard block
 block discarded – undo
373 372
             $pass = urlencode($pass);
374 373
 
375 374
             if ($url_parts[1] && $url_parts[2]) {
376
-                $url = $url_parts[1] . "://$login:$pass@" . $url_parts[2];
375
+                $url = $url_parts[1]."://$login:$pass@".$url_parts[2];
377 376
             }
378 377
         }
379 378
 
@@ -441,7 +440,7 @@  discard block
 block discarded – undo
441 440
             $error = error_get_last();
442 441
 
443 442
             if ($error['message'] != $old_error['message']) {
444
-                $fetch_last_error .= "; " . $error["message"];
443
+                $fetch_last_error .= "; ".$error["message"];
445 444
             }
446 445
 
447 446
             $fetch_last_error_content = $data;
@@ -516,15 +515,15 @@  discard block
 block discarded – undo
516 515
 
517 516
 function get_ssl_certificate_id() {
518 517
     if ($_SERVER["REDIRECT_SSL_CLIENT_M_SERIAL"]) {
519
-        return sha1($_SERVER["REDIRECT_SSL_CLIENT_M_SERIAL"] .
520
-            $_SERVER["REDIRECT_SSL_CLIENT_V_START"] .
521
-            $_SERVER["REDIRECT_SSL_CLIENT_V_END"] .
518
+        return sha1($_SERVER["REDIRECT_SSL_CLIENT_M_SERIAL"].
519
+            $_SERVER["REDIRECT_SSL_CLIENT_V_START"].
520
+            $_SERVER["REDIRECT_SSL_CLIENT_V_END"].
522 521
             $_SERVER["REDIRECT_SSL_CLIENT_S_DN"]);
523 522
     }
524 523
     if ($_SERVER["SSL_CLIENT_M_SERIAL"]) {
525
-        return sha1($_SERVER["SSL_CLIENT_M_SERIAL"] .
526
-            $_SERVER["SSL_CLIENT_V_START"] .
527
-            $_SERVER["SSL_CLIENT_V_END"] .
524
+        return sha1($_SERVER["SSL_CLIENT_M_SERIAL"].
525
+            $_SERVER["SSL_CLIENT_V_START"].
526
+            $_SERVER["SSL_CLIENT_V_END"].
528 527
             $_SERVER["SSL_CLIENT_S_DN"]);
529 528
     }
530 529
     return "";
@@ -659,7 +658,7 @@  discard block
 block discarded – undo
659 658
 function logout_user() {
660 659
     @session_destroy();
661 660
     if (isset($_COOKIE[session_name()])) {
662
-       setcookie(session_name(), '', time()-42000, '/');
661
+       setcookie(session_name(), '', time() - 42000, '/');
663 662
     }
664 663
     session_commit();
665 664
 }
@@ -743,7 +742,7 @@  discard block
 block discarded – undo
743 742
 
744 743
 function truncate_string($str, $max_len, $suffix = '&hellip;') {
745 744
     if (mb_strlen($str, "utf-8") > $max_len) {
746
-        return mb_substr($str, 0, $max_len, "utf-8") . $suffix;
745
+        return mb_substr($str, 0, $max_len, "utf-8").$suffix;
747 746
     } else {
748 747
         return $str;
749 748
     }
@@ -753,7 +752,7 @@  discard block
 block discarded – undo
753 752
     $startString = mb_substr($original, 0, $position, "UTF-8");
754 753
     $endString = mb_substr($original, $position + $length, mb_strlen($original), "UTF-8");
755 754
 
756
-    $out = $startString . $replacement . $endString;
755
+    $out = $startString.$replacement.$endString;
757 756
 
758 757
     return $out;
759 758
 }
@@ -891,9 +890,9 @@  discard block
 block discarded – undo
891 890
 }
892 891
 
893 892
 function file_is_locked($filename) {
894
-    if (file_exists(LOCK_DIRECTORY . "/$filename")) {
893
+    if (file_exists(LOCK_DIRECTORY."/$filename")) {
895 894
         if (function_exists('flock')) {
896
-            $fp = @fopen(LOCK_DIRECTORY . "/$filename", "r");
895
+            $fp = @fopen(LOCK_DIRECTORY."/$filename", "r");
897 896
             if ($fp) {
898 897
                 if (flock($fp, LOCK_EX | LOCK_NB)) {
899 898
                     flock($fp, LOCK_UN);
@@ -914,11 +913,11 @@  discard block
 block discarded – undo
914 913
 
915 914
 
916 915
 function make_lockfile($filename) {
917
-    $fp = fopen(LOCK_DIRECTORY . "/$filename", "w");
916
+    $fp = fopen(LOCK_DIRECTORY."/$filename", "w");
918 917
 
919 918
     if ($fp && flock($fp, LOCK_EX | LOCK_NB)) {
920 919
         $stat_h = fstat($fp);
921
-        $stat_f = stat(LOCK_DIRECTORY . "/$filename");
920
+        $stat_f = stat(LOCK_DIRECTORY."/$filename");
922 921
 
923 922
         if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
924 923
             if ($stat_h["ino"] != $stat_f["ino"] ||
@@ -929,7 +928,7 @@  discard block
 block discarded – undo
929 928
         }
930 929
 
931 930
         if (function_exists('posix_getpid')) {
932
-            fwrite($fp, posix_getpid() . "\n");
931
+            fwrite($fp, posix_getpid()."\n");
933 932
         }
934 933
         return $fp;
935 934
     } else {
@@ -938,10 +937,10 @@  discard block
 block discarded – undo
938 937
 }
939 938
 
940 939
 function make_stampfile($filename) {
941
-    $fp = fopen(LOCK_DIRECTORY . "/$filename", "w");
940
+    $fp = fopen(LOCK_DIRECTORY."/$filename", "w");
942 941
 
943 942
     if (flock($fp, LOCK_EX | LOCK_NB)) {
944
-        fwrite($fp, time() . "\n");
943
+        fwrite($fp, time()."\n");
945 944
         flock($fp, LOCK_UN);
946 945
         fclose($fp);
947 946
         return true;
@@ -991,7 +990,7 @@  discard block
 block discarded – undo
991 990
     $params["is_default_pw"] = Pref_Prefs::isdefaultpassword();
992 991
     $params["label_base_index"] = (int) LABEL_BASE_INDEX;
993 992
 
994
-    $theme = get_pref( "USER_CSS_THEME", false, false);
993
+    $theme = get_pref("USER_CSS_THEME", false, false);
995 994
     $params["theme"] = theme_exists($theme) ? $theme : "";
996 995
 
997 996
     $params["plugins"] = implode(", ", PluginHost::getInstance()->get_plugin_names());
@@ -1215,13 +1214,13 @@  discard block
 block discarded – undo
1215 1214
         }
1216 1215
     }
1217 1216
 
1218
-    if (file_exists(LOCK_DIRECTORY . "/update_daemon.lock")) {
1217
+    if (file_exists(LOCK_DIRECTORY."/update_daemon.lock")) {
1219 1218
 
1220 1219
         $data['daemon_is_running'] = (int) file_is_locked("update_daemon.lock");
1221 1220
 
1222 1221
         if (time() - $_SESSION["daemon_stamp_check"] > 30) {
1223 1222
 
1224
-            $stamp = (int) @file_get_contents(LOCK_DIRECTORY . "/update_daemon.stamp");
1223
+            $stamp = (int) @file_get_contents(LOCK_DIRECTORY."/update_daemon.stamp");
1225 1224
 
1226 1225
             if ($stamp) {
1227 1226
                 $stamp_delta = time() - $stamp;
@@ -1264,7 +1263,7 @@  discard block
 block discarded – undo
1264 1263
     $res = trim($str); if (!$res) return '';
1265 1264
 
1266 1265
     $doc = new DOMDocument();
1267
-    $doc->loadHTML('<?xml encoding="UTF-8">' . $res);
1266
+    $doc->loadHTML('<?xml encoding="UTF-8">'.$res);
1268 1267
     $xpath = new DOMXPath($doc);
1269 1268
 
1270 1269
     $rewrite_base_url = $site_url ? $site_url : get_self_url_prefix();
@@ -1363,7 +1362,7 @@  discard block
 block discarded – undo
1363 1362
         'ol', 'p', 'picture', 'pre', 'q', 'ruby', 'rp', 'rt', 's', 'samp', 'section',
1364 1363
         'small', 'source', 'span', 'strike', 'strong', 'sub', 'summary',
1365 1364
         'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'time',
1366
-        'tr', 'track', 'tt', 'u', 'ul', 'var', 'wbr', 'video', 'xml:namespace' );
1365
+        'tr', 'track', 'tt', 'u', 'ul', 'var', 'wbr', 'video', 'xml:namespace');
1367 1366
 
1368 1367
     if ($_SESSION['hasSandbox']) $allowed_elements[] = 'iframe';
1369 1368
 
@@ -1498,8 +1497,8 @@  discard block
 block discarded – undo
1498 1497
 
1499 1498
 // this returns SELF_URL_PATH sans ending slash
1500 1499
 function get_self_url_prefix() {
1501
-    if (strrpos(SELF_URL_PATH, "/") === strlen(SELF_URL_PATH)-1) {
1502
-        return substr(SELF_URL_PATH, 0, strlen(SELF_URL_PATH)-1);
1500
+    if (strrpos(SELF_URL_PATH, "/") === strlen(SELF_URL_PATH) - 1) {
1501
+        return substr(SELF_URL_PATH, 0, strlen(SELF_URL_PATH) - 1);
1503 1502
     } else {
1504 1503
         return SELF_URL_PATH;
1505 1504
     }
@@ -1508,11 +1507,11 @@  discard block
 block discarded – undo
1508 1507
 /* TODO: This needs to use bcrypt */
1509 1508
 function encrypt_password($pass, $salt = '', $mode2 = false) {
1510 1509
     if ($salt && $mode2) {
1511
-        return "MODE2:" . hash('sha256', $salt . $pass);
1510
+        return "MODE2:".hash('sha256', $salt.$pass);
1512 1511
     } else if ($salt) {
1513
-        return "SHA1X:" . sha1("$salt:$pass");
1512
+        return "SHA1X:".sha1("$salt:$pass");
1514 1513
     } else {
1515
-        return "SHA1:" . sha1($pass);
1514
+        return "SHA1:".sha1($pass);
1516 1515
     }
1517 1516
 }
1518 1517
 
@@ -1523,7 +1522,7 @@  discard block
 block discarded – undo
1523 1522
 }
1524 1523
 
1525 1524
 function build_url($parts) {
1526
-    return $parts['scheme'] . "://" . $parts['host'] . $parts['path'];
1525
+    return $parts['scheme']."://".$parts['host'].$parts['path'];
1527 1526
 }
1528 1527
 
1529 1528
 function cleanup_url_path($path) {
@@ -1567,7 +1566,7 @@  discard block
 block discarded – undo
1567 1566
             $dir = dirname($parts['path']);
1568 1567
             $dir !== '/' && $dir .= '/';
1569 1568
         }
1570
-        $parts['path'] = $dir . $rel_url;
1569
+        $parts['path'] = $dir.$rel_url;
1571 1570
         $parts['path'] = cleanup_url_path($parts['path']);
1572 1571
 
1573 1572
         return build_url($parts);
@@ -1654,12 +1653,12 @@  discard block
 block discarded – undo
1654 1653
 
1655 1654
         for ($i = 0; $i < $l10n->total; $i++) {
1656 1655
             $orig = $l10n->get_original_string($i);
1657
-            if(strpos($orig, "\000") !== FALSE) { // Plural forms
1656
+            if (strpos($orig, "\000") !== FALSE) { // Plural forms
1658 1657
                 $key = explode(chr(0), $orig);
1659 1658
                 print T_js_decl($key[0], _ngettext($key[0], $key[1], 1)); // Singular
1660 1659
                 print T_js_decl($key[1], _ngettext($key[0], $key[1], 2)); // Plural
1661 1660
             } else {
1662
-                $translation = _dgettext($domain,$orig);
1661
+                $translation = _dgettext($domain, $orig);
1663 1662
                 print T_js_decl($orig, $translation);
1664 1663
             }
1665 1664
         }
@@ -1715,7 +1714,7 @@  discard block
 block discarded – undo
1715 1714
     if (file_exists($filename)) {
1716 1715
         $ext = pathinfo($filename, PATHINFO_EXTENSION);
1717 1716
 
1718
-        return "data:image/$ext;base64," . base64_encode(file_get_contents($filename));
1717
+        return "data:image/$ext;base64,".base64_encode(file_get_contents($filename));
1719 1718
     } else {
1720 1719
         return "";
1721 1720
     }
@@ -1752,7 +1751,7 @@  discard block
 block discarded – undo
1752 1751
 
1753 1752
         header("Content-type: $mimetype");
1754 1753
 
1755
-        $stamp = gmdate("D, d M Y H:i:s", filemtime($filename)) . " GMT";
1754
+        $stamp = gmdate("D, d M Y H:i:s", filemtime($filename))." GMT";
1756 1755
         header("Last-Modified: $stamp", true);
1757 1756
 
1758 1757
         return readfile($filename);
@@ -1762,7 +1761,7 @@  discard block
 block discarded – undo
1762 1761
 }
1763 1762
 
1764 1763
 function arr_qmarks($arr) {
1765
-    return str_repeat('?,', count($arr) - 1) . '?';
1764
+    return str_repeat('?,', count($arr) - 1).'?';
1766 1765
 }
1767 1766
 
1768 1767
 function get_scripts_timestamp() {
@@ -1797,7 +1796,7 @@  discard block
 block discarded – undo
1797 1796
     } else if (PHP_OS === "Darwin") {
1798 1797
         $ttrss_version = "UNKNOWN (Unsupported, Darwin)";
1799 1798
     } else if (file_exists("$root_dir/version_static.txt")) {
1800
-        $ttrss_version = trim(file_get_contents("$root_dir/version_static.txt")) . " (Unsupported)";
1799
+        $ttrss_version = trim(file_get_contents("$root_dir/version_static.txt"))." (Unsupported)";
1801 1800
     } else if (is_dir("$root_dir/.git")) {
1802 1801
         $rc = 0;
1803 1802
         $output = [];
@@ -1815,10 +1814,10 @@  discard block
 block discarded – undo
1815 1814
                 $git_commit = $commit;
1816 1815
                 $git_timestamp = $timestamp;
1817 1816
 
1818
-                $ttrss_version = strftime("%y.%m", $timestamp) . "-$commit";
1817
+                $ttrss_version = strftime("%y.%m", $timestamp)."-$commit";
1819 1818
             }
1820 1819
         } else {
1821
-            user_error("Unable to determine version (using $root_dir): " . implode("\n", $output), E_USER_WARNING);
1820
+            user_error("Unable to determine version (using $root_dir): ".implode("\n", $output), E_USER_WARNING);
1822 1821
         }
1823 1822
     }
1824 1823
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
         $contents = substr($ret, $headers_length);
308 308
 
309 309
         foreach ($headers as $header) {
310
-            if (strstr($header, ": ") !== FALSE) {
310
+            if (strstr($header, ": ") !== false) {
311 311
                 list ($key, $value) = explode(": ", $header);
312 312
 
313 313
                 if (strtolower($key) == "last-modified") {
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
 
415 415
         if (isset($http_response_header) && is_array($http_response_header)) {
416 416
             foreach ($http_response_header as $header) {
417
-                if (strstr($header, ": ") !== FALSE) {
417
+                if (strstr($header, ": ") !== false) {
418 418
                     list ($key, $value) = explode(": ", $header);
419 419
 
420 420
                     $key = strtolower($key);
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
     }
492 492
 
493 493
     while ($line = $sth->fetch()) {
494
-        if (array_search($line["pref_name"], $active_prefs) === FALSE) {
494
+        if (array_search($line["pref_name"], $active_prefs) === false) {
495 495
 //				print "adding " . $line["pref_name"] . "<br>";
496 496
 
497 497
             if (get_schema_version() < 63) {
@@ -1654,7 +1654,7 @@  discard block
 block discarded – undo
1654 1654
 
1655 1655
         for ($i = 0; $i < $l10n->total; $i++) {
1656 1656
             $orig = $l10n->get_original_string($i);
1657
-            if(strpos($orig, "\000") !== FALSE) { // Plural forms
1657
+            if(strpos($orig, "\000") !== false) { // Plural forms
1658 1658
                 $key = explode(chr(0), $orig);
1659 1659
                 print T_js_decl($key[0], _ngettext($key[0], $key[1], 1)); // Singular
1660 1660
                 print T_js_decl($key[1], _ngettext($key[0], $key[1], 2)); // Plural
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -379,8 +379,8 @@  discard block
 block discarded – undo
379 379
 
380 380
         // TODO: should this support POST requests or not? idk
381 381
 
382
-         $context_options = array(
383
-              'http' => array(
382
+            $context_options = array(
383
+                'http' => array(
384 384
                     'header' => array(
385 385
                         'Connection: close'
386 386
                     ),
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
                     'ignore_errors' => true,
389 389
                     'timeout' => $timeout ? $timeout : FILE_FETCH_TIMEOUT,
390 390
                     'protocol_version'=> 1.1)
391
-              );
391
+                );
392 392
 
393 393
         if (!$post_query && $last_modified)
394 394
             array_push($context_options['http']['header'], "If-Modified-Since: $last_modified");
@@ -659,7 +659,7 @@  discard block
 block discarded – undo
659 659
 function logout_user() {
660 660
     @session_destroy();
661 661
     if (isset($_COOKIE[session_name()])) {
662
-       setcookie(session_name(), '', time()-42000, '/');
662
+        setcookie(session_name(), '', time()-42000, '/');
663 663
     }
664 664
     session_commit();
665 665
 }
@@ -699,7 +699,7 @@  discard block
 block discarded – undo
699 699
             if (AUTH_AUTO_LOGIN && authenticate_user(null, null)) {
700 700
                 $_SESSION["ref_schema_version"] = get_schema_version(true);
701 701
             } else {
702
-                 authenticate_user(null, null, true);
702
+                    authenticate_user(null, null, true);
703 703
             }
704 704
 
705 705
             if (!$_SESSION["uid"]) {
@@ -974,9 +974,9 @@  discard block
 block discarded – undo
974 974
     $params = array();
975 975
 
976 976
     foreach (array("ON_CATCHUP_SHOW_NEXT_FEED", "HIDE_READ_FEEDS",
977
-                 "ENABLE_FEED_CATS", "FEEDS_SORT_BY_UNREAD", "CONFIRM_FEED_CATCHUP",
978
-                 "CDM_AUTO_CATCHUP", "FRESH_ARTICLE_MAX_AGE",
979
-                 "HIDE_READ_SHOWS_SPECIAL", "COMBINED_DISPLAY_MODE") as $param) {
977
+                    "ENABLE_FEED_CATS", "FEEDS_SORT_BY_UNREAD", "CONFIRM_FEED_CATCHUP",
978
+                    "CDM_AUTO_CATCHUP", "FRESH_ARTICLE_MAX_AGE",
979
+                    "HIDE_READ_SHOWS_SPECIAL", "COMBINED_DISPLAY_MODE") as $param) {
980 980
 
981 981
         $params[strtolower($param)] = (int) get_pref($param);
982 982
     }
Please login to merge, or discard this patch.
Braces   +128 added lines, -65 removed lines patch added patch discarded remove patch
@@ -18,7 +18,9 @@  discard block
 block discarded – undo
18 18
 libxml_use_internal_errors(true);
19 19
 
20 20
 // separate test because this is included before sanity checks
21
-if (function_exists("mb_internal_encoding")) mb_internal_encoding("UTF-8");
21
+if (function_exists("mb_internal_encoding")) {
22
+    mb_internal_encoding("UTF-8");
23
+}
22 24
 
23 25
 date_default_timezone_set('UTC');
24 26
 if (defined('E_DEPRECATED')) {
@@ -195,8 +197,9 @@  discard block
 block discarded – undo
195 197
     $fetch_last_modified = "";
196 198
     $fetch_effective_url = "";
197 199
 
198
-    if (!is_array($fetch_domain_hits))
199
-        $fetch_domain_hits = [];
200
+    if (!is_array($fetch_domain_hits)) {
201
+            $fetch_domain_hits = [];
202
+    }
200 203
 
201 204
     if (!is_array($options)) {
202 205
 
@@ -227,8 +230,9 @@  discard block
 block discarded – undo
227 230
     $url = ltrim($url, ' ');
228 231
     $url = str_replace(' ', '%20', $url);
229 232
 
230
-    if (strpos($url, "//") === 0)
231
-        $url = 'http:' . $url;
233
+    if (strpos($url, "//") === 0) {
234
+            $url = 'http:' . $url;
235
+    }
232 236
 
233 237
     $url_host = parse_url($url, PHP_URL_HOST);
234 238
     $fetch_domain_hits[$url_host] += 1;
@@ -246,14 +250,17 @@  discard block
 block discarded – undo
246 250
 
247 251
         $curl_http_headers = [];
248 252
 
249
-        if ($last_modified && !$post_query)
250
-            array_push($curl_http_headers, "If-Modified-Since: $last_modified");
253
+        if ($last_modified && !$post_query) {
254
+                    array_push($curl_http_headers, "If-Modified-Since: $last_modified");
255
+        }
251 256
 
252
-        if ($http_accept)
253
-            array_push($curl_http_headers, "Accept: " . $http_accept);
257
+        if ($http_accept) {
258
+                    array_push($curl_http_headers, "Accept: " . $http_accept);
259
+        }
254 260
 
255
-        if (count($curl_http_headers) > 0)
256
-            curl_setopt($ch, CURLOPT_HTTPHEADER, $curl_http_headers);
261
+        if (count($curl_http_headers) > 0) {
262
+                    curl_setopt($ch, CURLOPT_HTTPHEADER, $curl_http_headers);
263
+        }
257 264
 
258 265
         curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout ? $timeout : FILE_FETCH_CONNECT_TIMEOUT);
259 266
         curl_setopt($ch, CURLOPT_TIMEOUT, $timeout ? $timeout : FILE_FETCH_TIMEOUT);
@@ -267,8 +274,9 @@  discard block
 block discarded – undo
267 274
             SELF_USER_AGENT);
268 275
         curl_setopt($ch, CURLOPT_ENCODING, "");
269 276
 
270
-        if  ($http_referrer)
271
-            curl_setopt($ch, CURLOPT_REFERER, $http_referrer);
277
+        if  ($http_referrer) {
278
+                    curl_setopt($ch, CURLOPT_REFERER, $http_referrer);
279
+        }
272 280
 
273 281
         if ($max_size) {
274 282
             curl_setopt($ch, CURLOPT_NOPROGRESS, false);
@@ -297,8 +305,9 @@  discard block
 block discarded – undo
297 305
             curl_setopt($ch, CURLOPT_POSTFIELDS, $post_query);
298 306
         }
299 307
 
300
-        if ($login && $pass)
301
-            curl_setopt($ch, CURLOPT_USERPWD, "$login:$pass");
308
+        if ($login && $pass) {
309
+                    curl_setopt($ch, CURLOPT_USERPWD, "$login:$pass");
310
+        }
302 311
 
303 312
         $ret = @curl_exec($ch);
304 313
 
@@ -357,7 +366,9 @@  discard block
 block discarded – undo
357 366
         if ($is_gzipped) {
358 367
             $tmp = @gzdecode($contents);
359 368
 
360
-            if ($tmp) $contents = $tmp;
369
+            if ($tmp) {
370
+                $contents = $tmp;
371
+            }
361 372
         }
362 373
 
363 374
         return $contents;
@@ -390,14 +401,17 @@  discard block
 block discarded – undo
390 401
                     'protocol_version'=> 1.1)
391 402
               );
392 403
 
393
-        if (!$post_query && $last_modified)
394
-            array_push($context_options['http']['header'], "If-Modified-Since: $last_modified");
404
+        if (!$post_query && $last_modified) {
405
+                    array_push($context_options['http']['header'], "If-Modified-Since: $last_modified");
406
+        }
395 407
 
396
-        if ($http_accept)
397
-            array_push($context_options['http']['header'], "Accept: $http_accept");
408
+        if ($http_accept) {
409
+                    array_push($context_options['http']['header'], "Accept: $http_accept");
410
+        }
398 411
 
399
-        if ($http_referrer)
400
-            array_push($context_options['http']['header'], "Referer: $http_referrer");
412
+        if ($http_referrer) {
413
+                    array_push($context_options['http']['header'], "Referer: $http_referrer");
414
+        }
401 415
 
402 416
         if (defined('_HTTP_PROXY')) {
403 417
             $context_options['http']['request_fulluri'] = true;
@@ -454,7 +468,9 @@  discard block
 block discarded – undo
454 468
         if ($is_gzipped) {
455 469
             $tmp = @gzdecode($data);
456 470
 
457
-            if ($tmp) $data = $tmp;
471
+            if ($tmp) {
472
+                $data = $tmp;
473
+            }
458 474
         }
459 475
 
460 476
         return $data;
@@ -464,7 +480,9 @@  discard block
 block discarded – undo
464 480
 
465 481
 function initialize_user_prefs($uid, $profile = false) {
466 482
 
467
-    if (get_schema_version() < 63) $profile_qpart = "";
483
+    if (get_schema_version() < 63) {
484
+        $profile_qpart = "";
485
+    }
468 486
 
469 487
     $pdo = DB::pdo();
470 488
     $in_nested_tr = false;
@@ -477,7 +495,9 @@  discard block
 block discarded – undo
477 495
 
478 496
     $sth = $pdo->query("SELECT pref_name,def_value FROM ttrss_prefs");
479 497
 
480
-    if (!is_numeric($profile) || !$profile || get_schema_version() < 63) $profile = null;
498
+    if (!is_numeric($profile) || !$profile || get_schema_version() < 63) {
499
+        $profile = null;
500
+    }
481 501
 
482 502
     $u_sth = $pdo->prepare("SELECT pref_name
483 503
         FROM ttrss_user_prefs WHERE owner_uid = :uid AND
@@ -510,7 +530,9 @@  discard block
 block discarded – undo
510 530
         }
511 531
     }
512 532
 
513
-    if (!$in_nested_tr) $pdo->commit();
533
+    if (!$in_nested_tr) {
534
+        $pdo->commit();
535
+    }
514 536
 
515 537
 }
516 538
 
@@ -670,7 +692,9 @@  discard block
 block discarded – undo
670 692
 
671 693
 function load_user_plugins($owner_uid, $pluginhost = false) {
672 694
 
673
-    if (!$pluginhost) $pluginhost = PluginHost::getInstance();
695
+    if (!$pluginhost) {
696
+        $pluginhost = PluginHost::getInstance();
697
+    }
674 698
 
675 699
     if ($owner_uid && SCHEMA_VERSION >= 100) {
676 700
         $plugins = get_pref("_ENABLED_PLUGINS", $owner_uid);
@@ -692,7 +716,9 @@  discard block
 block discarded – undo
692 716
         startup_gettext();
693 717
         load_user_plugins($_SESSION["uid"]);
694 718
     } else {
695
-        if (!validate_session()) $_SESSION["uid"] = false;
719
+        if (!validate_session()) {
720
+            $_SESSION["uid"] = false;
721
+        }
696 722
 
697 723
         if (!$_SESSION["uid"]) {
698 724
 
@@ -787,13 +813,19 @@  discard block
 block discarded – undo
787 813
 function make_local_datetime($timestamp, $long, $owner_uid = false,
788 814
                 $no_smart_dt = false, $eta_min = false) {
789 815
 
790
-    if (!$owner_uid) $owner_uid = $_SESSION['uid'];
791
-    if (!$timestamp) $timestamp = '1970-01-01 0:00';
816
+    if (!$owner_uid) {
817
+        $owner_uid = $_SESSION['uid'];
818
+    }
819
+    if (!$timestamp) {
820
+        $timestamp = '1970-01-01 0:00';
821
+    }
792 822
 
793 823
     global $utc_tz;
794 824
     global $user_tz;
795 825
 
796
-    if (!$utc_tz) $utc_tz = new DateTimeZone('UTC');
826
+    if (!$utc_tz) {
827
+        $utc_tz = new DateTimeZone('UTC');
828
+    }
797 829
 
798 830
     $timestamp = substr($timestamp, 0, 19);
799 831
 
@@ -805,7 +837,9 @@  discard block
 block discarded – undo
805 837
     if ($user_tz_string != 'Automatic') {
806 838
 
807 839
         try {
808
-            if (!$user_tz) $user_tz = new DateTimeZone($user_tz_string);
840
+            if (!$user_tz) {
841
+                $user_tz = new DateTimeZone($user_tz_string);
842
+            }
809 843
         } catch (Exception $e) {
810 844
             $user_tz = $utc_tz;
811 845
         }
@@ -821,26 +855,30 @@  discard block
 block discarded – undo
821 855
         return smart_date_time($user_timestamp,
822 856
             $tz_offset, $owner_uid, $eta_min);
823 857
     } else {
824
-        if ($long)
825
-            $format = get_pref('LONG_DATE_FORMAT', $owner_uid);
826
-        else
827
-            $format = get_pref('SHORT_DATE_FORMAT', $owner_uid);
858
+        if ($long) {
859
+                    $format = get_pref('LONG_DATE_FORMAT', $owner_uid);
860
+        } else {
861
+                    $format = get_pref('SHORT_DATE_FORMAT', $owner_uid);
862
+        }
828 863
 
829 864
         return date($format, $user_timestamp);
830 865
     }
831 866
 }
832 867
 
833 868
 function smart_date_time($timestamp, $tz_offset = 0, $owner_uid = false, $eta_min = false) {
834
-    if (!$owner_uid) $owner_uid = $_SESSION['uid'];
869
+    if (!$owner_uid) {
870
+        $owner_uid = $_SESSION['uid'];
871
+    }
835 872
 
836 873
     if ($eta_min && time() + $tz_offset - $timestamp < 3600) {
837 874
         return T_sprintf("%d min", date("i", time() + $tz_offset - $timestamp));
838 875
     } else if (date("Y.m.d", $timestamp) == date("Y.m.d", time() + $tz_offset)) {
839 876
         $format = get_pref('SHORT_DATE_FORMAT', $owner_uid);
840
-        if (strpos((strtolower($format)), "a") === false)
841
-            return date("G:i", $timestamp);
842
-        else
843
-            return date("g:i a", $timestamp);
877
+        if (strpos((strtolower($format)), "a") === false) {
878
+                    return date("G:i", $timestamp);
879
+        } else {
880
+                    return date("g:i a", $timestamp);
881
+        }
844 882
     } else if (date("Y", $timestamp) == date("Y", time() + $tz_offset)) {
845 883
         $format = get_pref('SHORT_DATE_FORMAT', $owner_uid);
846 884
         return date($format, $timestamp);
@@ -1250,8 +1288,9 @@  discard block
 block discarded – undo
1250 1288
 
1251 1289
     if ($src) {
1252 1290
         foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_IFRAME_WHITELISTED) as $plugin) {
1253
-            if ($plugin->hook_iframe_whitelisted($src))
1254
-                return true;
1291
+            if ($plugin->hook_iframe_whitelisted($src)) {
1292
+                            return true;
1293
+            }
1255 1294
         }
1256 1295
     }
1257 1296
 
@@ -1259,9 +1298,13 @@  discard block
 block discarded – undo
1259 1298
 }
1260 1299
 
1261 1300
 function sanitize($str, $force_remove_images = false, $owner = false, $site_url = false, $highlight_words = false, $article_id = false) {
1262
-    if (!$owner) $owner = $_SESSION["uid"];
1301
+    if (!$owner) {
1302
+        $owner = $_SESSION["uid"];
1303
+    }
1263 1304
 
1264
-    $res = trim($str); if (!$res) return '';
1305
+    $res = trim($str); if (!$res) {
1306
+        return '';
1307
+    }
1265 1308
 
1266 1309
     $doc = new DOMDocument();
1267 1310
     $doc->loadHTML('<?xml encoding="UTF-8">' . $res);
@@ -1323,13 +1366,15 @@  discard block
 block discarded – undo
1323 1366
 
1324 1367
             if ($entry->nodeName == 'source') {
1325 1368
 
1326
-                if ($entry->parentNode && $entry->parentNode->parentNode)
1327
-                    $entry->parentNode->parentNode->replaceChild($p, $entry->parentNode);
1369
+                if ($entry->parentNode && $entry->parentNode->parentNode) {
1370
+                                    $entry->parentNode->parentNode->replaceChild($p, $entry->parentNode);
1371
+                }
1328 1372
 
1329 1373
             } else if ($entry->nodeName == 'img') {
1330 1374
 
1331
-                if ($entry->parentNode)
1332
-                    $entry->parentNode->replaceChild($p, $entry);
1375
+                if ($entry->parentNode) {
1376
+                                    $entry->parentNode->replaceChild($p, $entry);
1377
+                }
1333 1378
 
1334 1379
             }
1335 1380
         }
@@ -1365,7 +1410,9 @@  discard block
 block discarded – undo
1365 1410
         'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'time',
1366 1411
         'tr', 'track', 'tt', 'u', 'ul', 'var', 'wbr', 'video', 'xml:namespace' );
1367 1412
 
1368
-    if ($_SESSION['hasSandbox']) $allowed_elements[] = 'iframe';
1413
+    if ($_SESSION['hasSandbox']) {
1414
+        $allowed_elements[] = 'iframe';
1415
+    }
1369 1416
 
1370 1417
     $disallowed_attributes = array('id', 'style', 'class');
1371 1418
 
@@ -1405,7 +1452,9 @@  discard block
 block discarded – undo
1405 1452
                     $text = mb_substr($text, $pos + mb_strlen($word));
1406 1453
                 }
1407 1454
 
1408
-                if (!empty($text)) $fragment->appendChild(new DomText($text));
1455
+                if (!empty($text)) {
1456
+                    $fragment->appendChild(new DomText($text));
1457
+                }
1409 1458
 
1410 1459
                 $child->parentNode->replaceChild($fragment, $child);
1411 1460
             }
@@ -1596,8 +1645,9 @@  discard block
 block discarded – undo
1596 1645
     } else {
1597 1646
         $output = "";
1598 1647
 
1599
-        for ($i = 0; $i < $length; $i++)
1600
-            $output .= chr(mt_rand(0, 255));
1648
+        for ($i = 0; $i < $length; $i++) {
1649
+                    $output .= chr(mt_rand(0, 255));
1650
+        }
1601 1651
 
1602 1652
         return $output;
1603 1653
     }
@@ -1667,15 +1717,20 @@  discard block
 block discarded – undo
1667 1717
 }
1668 1718
 
1669 1719
 function get_theme_path($theme) {
1670
-    if ($theme == "default.php")
1671
-        return "css/default.css";
1720
+    if ($theme == "default.php") {
1721
+            return "css/default.css";
1722
+    }
1672 1723
 
1673 1724
     $check = "themes/$theme";
1674
-    if (file_exists($check)) return $check;
1725
+    if (file_exists($check)) {
1726
+        return $check;
1727
+    }
1675 1728
 
1676 1729
     $check = "themes.local/$theme";
1677
-    if (file_exists($check)) return $check;
1678
-}
1730
+    if (file_exists($check)) {
1731
+        return $check;
1732
+    }
1733
+    }
1679 1734
 
1680 1735
 function theme_exists($theme) {
1681 1736
     return file_exists("themes/$theme") || file_exists("themes.local/$theme");
@@ -1731,7 +1786,9 @@  discard block
 block discarded – undo
1731 1786
 function send_local_file($filename) {
1732 1787
     if (file_exists($filename)) {
1733 1788
 
1734
-        if (is_writable($filename)) touch($filename);
1789
+        if (is_writable($filename)) {
1790
+            touch($filename);
1791
+        }
1735 1792
 
1736 1793
         $tmppluginhost = new PluginHost();
1737 1794
 
@@ -1739,7 +1796,9 @@  discard block
 block discarded – undo
1739 1796
         $tmppluginhost->load_data();
1740 1797
 
1741 1798
         foreach ($tmppluginhost->get_hooks(PluginHost::HOOK_SEND_LOCAL_FILE) as $plugin) {
1742
-            if ($plugin->hook_send_local_file($filename)) return true;
1799
+            if ($plugin->hook_send_local_file($filename)) {
1800
+                return true;
1801
+            }
1743 1802
         }
1744 1803
 
1745 1804
         $mimetype = mime_content_type($filename);
@@ -1747,8 +1806,9 @@  discard block
 block discarded – undo
1747 1806
         // this is hardly ideal but 1) only media is cached in images/ and 2) seemingly only mp4
1748 1807
         // video files are detected as octet-stream by mime_content_type()
1749 1808
 
1750
-        if ($mimetype == "application/octet-stream")
1751
-            $mimetype = "video/mp4";
1809
+        if ($mimetype == "application/octet-stream") {
1810
+                    $mimetype = "video/mp4";
1811
+        }
1752 1812
 
1753 1813
         header("Content-type: $mimetype");
1754 1814
 
@@ -1771,7 +1831,9 @@  discard block
 block discarded – undo
1771 1831
 
1772 1832
     foreach ($files as $file) {
1773 1833
         $file_ts = filemtime($file);
1774
-        if ($file_ts > $ts) $ts = $file_ts;
1834
+        if ($file_ts > $ts) {
1835
+            $ts = $file_ts;
1836
+        }
1775 1837
     }
1776 1838
 
1777 1839
     return $ts;
@@ -1784,8 +1846,9 @@  discard block
 block discarded – undo
1784 1846
 function get_version(&$git_commit = false, &$git_timestamp = false) {
1785 1847
     global $ttrss_version;
1786 1848
 
1787
-    if (isset($ttrss_version))
1788
-        return $ttrss_version;
1849
+    if (isset($ttrss_version)) {
1850
+            return $ttrss_version;
1851
+    }
1789 1852
 
1790 1853
     $ttrss_version = "UNKNOWN (Unsupported)";
1791 1854
 
Please login to merge, or discard this patch.
include/sessions.php 3 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -78,11 +78,11 @@  discard block
 block discarded – undo
78 78
     return true;
79 79
 }
80 80
 
81
-function ttrss_open () {
81
+function ttrss_open() {
82 82
     return true;
83 83
 }
84 84
 
85
-function ttrss_read ($id){
85
+function ttrss_read($id) {
86 86
     global $session_expire;
87 87
 
88 88
     $sth = Db::pdo()->prepare("SELECT data FROM ttrss_sessions WHERE id=?");
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
     }
102 102
 }
103 103
 
104
-function ttrss_write ($id, $data) {
104
+function ttrss_write($id, $data) {
105 105
     global $session_expire;
106 106
 
107 107
     $data = base64_encode($data);
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
     return true;
122 122
 }
123 123
 
124
-function ttrss_close () {
124
+function ttrss_close() {
125 125
     return true;
126 126
 }
127 127
 
@@ -132,8 +132,8 @@  discard block
 block discarded – undo
132 132
     return true;
133 133
 }
134 134
 
135
-function ttrss_gc () {
136
-    Db::pdo()->query("DELETE FROM ttrss_sessions WHERE expire < " . time());
135
+function ttrss_gc() {
136
+    Db::pdo()->query("DELETE FROM ttrss_sessions WHERE expire < ".time());
137 137
 
138 138
     return true;
139 139
 }
Please login to merge, or discard this patch.
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
             __("Session failed to validate (schema version changed)");
43 43
         return false;
44 44
     }
45
-      $pdo = Db::pdo();
45
+        $pdo = Db::pdo();
46 46
 
47 47
     if ($_SESSION["uid"]) {
48 48
 
@@ -56,21 +56,21 @@  discard block
 block discarded – undo
56 56
 
57 57
         // user not found
58 58
         if ($row = $sth->fetch()) {
59
-                 $pwd_hash = $row["pwd_hash"];
59
+                    $pwd_hash = $row["pwd_hash"];
60 60
 
61
-                 if ($pwd_hash != $_SESSION["pwd_hash"]) {
61
+                    if ($pwd_hash != $_SESSION["pwd_hash"]) {
62 62
 
63
-                      $_SESSION["login_error_msg"] =
63
+                        $_SESSION["login_error_msg"] =
64 64
                             __("Session failed to validate (password changed)");
65 65
 
66
-                      return false;
67
-                 }
66
+                        return false;
67
+                    }
68 68
         } else {
69 69
 
70
-                 $_SESSION["login_error_msg"] =
71
-                      __("Session failed to validate (user not found)");
70
+                    $_SESSION["login_error_msg"] =
71
+                        __("Session failed to validate (user not found)");
72 72
 
73
-                 return false;
73
+                    return false;
74 74
 
75 75
         }
76 76
     }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,9 @@
 block discarded – undo
35 35
 }
36 36
 
37 37
 function validate_session() {
38
-    if (SINGLE_USER_MODE) return true;
38
+    if (SINGLE_USER_MODE) {
39
+        return true;
40
+    }
39 41
 
40 42
     if (isset($_SESSION["ref_schema_version"]) && $_SESSION["ref_schema_version"] != session_get_schema_version()) {
41 43
         $_SESSION["login_error_msg"] =
Please login to merge, or discard this patch.
api/index.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
         return;
69 69
     }
70 70
 
71
-    load_user_plugins( $_SESSION["uid"]);
71
+    load_user_plugins($_SESSION["uid"]);
72 72
 }
73 73
 
74 74
 $method = strtolower($_REQUEST["op"]);
@@ -84,6 +84,6 @@  discard block
 block discarded – undo
84 84
     $handler->after();
85 85
 }
86 86
 
87
-header("Api-Content-Length: " . ob_get_length());
87
+header("Api-Content-Length: ".ob_get_length());
88 88
 
89 89
 ob_end_flush();
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,7 +38,9 @@  discard block
 block discarded – undo
38 38
     // fallback on HTTP parameters
39 39
     if ($input) {
40 40
         $input = json_decode($input, true);
41
-        if ($input) $_REQUEST = $input;
41
+        if ($input) {
42
+            $_REQUEST = $input;
43
+        }
42 44
     }
43 45
 } else {
44 46
     // Accept JSON only
@@ -55,7 +57,9 @@  discard block
 block discarded – undo
55 57
 
56 58
 startup_gettext();
57 59
 
58
-if (!init_plugins()) return;
60
+if (!init_plugins()) {
61
+    return;
62
+}
59 63
 
60 64
 if ($_SESSION["uid"]) {
61 65
     if (!validate_session()) {
Please login to merge, or discard this patch.
update_daemon2.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  discard block
 block discarded – undo
1 1
 #!/usr/bin/env php
2 2
 <?php
3
-set_include_path(dirname(__FILE__) .DIRECTORY_SEPARATOR."include" . PATH_SEPARATOR .
3
+set_include_path(dirname(__FILE__).DIRECTORY_SEPARATOR."include".PATH_SEPARATOR.
4 4
     get_include_path());
5 5
 
6
-declare(ticks = 1);
6
+declare(ticks=1);
7 7
 chdir(dirname(__FILE__));
8 8
 
9 9
 define('DISABLE_SESSIONS', true);
@@ -93,9 +93,9 @@  discard block
 block discarded – undo
93 93
 
94 94
 function shutdown($caller_pid) {
95 95
     if ($caller_pid == posix_getpid()) {
96
-        if (file_exists(LOCK_DIRECTORY . "/update_daemon.lock")) {
96
+        if (file_exists(LOCK_DIRECTORY."/update_daemon.lock")) {
97 97
             Debug::log("removing lockfile (master)...");
98
-            unlink(LOCK_DIRECTORY . "/update_daemon.lock");
98
+            unlink(LOCK_DIRECTORY."/update_daemon.lock");
99 99
         }
100 100
     }
101 101
 }
@@ -103,9 +103,9 @@  discard block
 block discarded – undo
103 103
 function task_shutdown() {
104 104
     $pid = posix_getpid();
105 105
 
106
-    if (file_exists(LOCK_DIRECTORY . "/update_daemon-$pid.lock")) {
106
+    if (file_exists(LOCK_DIRECTORY."/update_daemon-$pid.lock")) {
107 107
         Debug::log("removing lockfile ($pid)...");
108
-        unlink(LOCK_DIRECTORY . "/update_daemon-$pid.lock");
108
+        unlink(LOCK_DIRECTORY."/update_daemon-$pid.lock");
109 109
     }
110 110
 }
111 111
 
@@ -134,15 +134,15 @@  discard block
 block discarded – undo
134 134
 
135 135
 $options = getopt("", $longopts);
136 136
 
137
-if (isset($options["help"]) ) {
137
+if (isset($options["help"])) {
138 138
     print "Tiny Tiny RSS update daemon.\n\n";
139 139
     print "Options:\n";
140 140
     print "  --log FILE           - log messages to FILE\n";
141 141
     print "  --log-level N        - log verbosity level\n";
142 142
     print "  --tasks N            - amount of update tasks to spawn\n";
143
-    print "                         default: " . MAX_JOBS . "\n";
143
+    print "                         default: ".MAX_JOBS."\n";
144 144
     print "  --interval N         - task spawn interval\n";
145
-    print "                         default: " . SPAWN_INTERVAL . " seconds.\n";
145
+    print "                         default: ".SPAWN_INTERVAL." seconds.\n";
146 146
     print "  --quiet              - don't output messages to stdout\n";
147 147
     return;
148 148
 }
@@ -150,13 +150,13 @@  discard block
 block discarded – undo
150 150
 Debug::set_enabled(true);
151 151
 
152 152
 if (isset($options["log-level"])) {
153
-    Debug::set_loglevel((int)$options["log-level"]);
153
+    Debug::set_loglevel((int) $options["log-level"]);
154 154
 }
155 155
 
156 156
 if (isset($options["log"])) {
157 157
     Debug::set_quiet(isset($options['quiet']));
158 158
     Debug::set_logfile($options["log"]);
159
-    Debug::log("Logging to " . $options["log"]);
159
+    Debug::log("Logging to ".$options["log"]);
160 160
 } else {
161 161
     if (isset($options['quiet'])) {
162 162
         Debug::set_loglevel(Debug::$LOG_DISABLED);
@@ -164,14 +164,14 @@  discard block
 block discarded – undo
164 164
 }
165 165
 
166 166
 if (isset($options["tasks"])) {
167
-    Debug::log("Set to spawn " . $options["tasks"] . " children.");
167
+    Debug::log("Set to spawn ".$options["tasks"]." children.");
168 168
     $max_jobs = $options["tasks"];
169 169
 } else {
170 170
     $max_jobs = MAX_JOBS;
171 171
 }
172 172
 
173 173
 if (isset($options["interval"])) {
174
-    Debug::log("Spawn interval: " . $options["interval"] . " seconds.");
174
+    Debug::log("Spawn interval: ".$options["interval"]." seconds.");
175 175
     $spawn_interval = $options["interval"];
176 176
 } else {
177 177
     $spawn_interval = SPAWN_INTERVAL;
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 
247 247
                 $my_pid = posix_getpid();
248 248
 
249
-                passthru(PHP_EXECUTABLE . " update.php --daemon-loop $quiet $log --task $j --pidlock $my_pid");
249
+                passthru(PHP_EXECUTABLE." update.php --daemon-loop $quiet $log --task $j --pidlock $my_pid");
250 250
 
251 251
                 sleep(1);
252 252
 
Please login to merge, or discard this patch.
update.php 4 patches
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 #!/usr/bin/env php
2 2
 <?php
3
-	set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR .
3
+	set_include_path(dirname(__FILE__)."/include".PATH_SEPARATOR.
4 4
 		get_include_path());
5 5
 
6 6
 	define('DISABLE_SESSIONS', true);
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 			"help");
89 89
 
90 90
 	foreach (PluginHost::getInstance()->get_commands() as $command => $data) {
91
-		array_push($longopts, $command . $data["suffix"]);
91
+		array_push($longopts, $command.$data["suffix"]);
92 92
 	}
93 93
 
94 94
 	$options = getopt("", $longopts);
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 		exit;
120 120
 	}
121 121
 
122
-	if (count($options) == 0 || isset($options["help"]) ) {
122
+	if (count($options) == 0 || isset($options["help"])) {
123 123
 		print "Tiny Tiny RSS data update script.\n\n";
124 124
 		print "Options:\n";
125 125
 		print "  --feeds              - update feeds\n";
@@ -165,13 +165,13 @@  discard block
 block discarded – undo
165 165
 	Debug::set_enabled(true);
166 166
 
167 167
 	if (isset($options["log-level"])) {
168
-	    Debug::set_loglevel((int)$options["log-level"]);
168
+	    Debug::set_loglevel((int) $options["log-level"]);
169 169
     }
170 170
 
171 171
 	if (isset($options["log"])) {
172 172
 		Debug::set_quiet(isset($options['quiet']));
173 173
 		Debug::set_logfile($options["log"]);
174
-        Debug::log("Logging to " . $options["log"]);
174
+        Debug::log("Logging to ".$options["log"]);
175 175
     } else {
176 176
 	    if (isset($options['quiet'])) {
177 177
 			Debug::set_loglevel(Debug::$LOG_DISABLED);
@@ -185,8 +185,8 @@  discard block
 block discarded – undo
185 185
 	}
186 186
 
187 187
 	if (isset($options["task"])) {
188
-		Debug::log("Using task id " . $options["task"]);
189
-		$lock_filename = $lock_filename . "-task_" . $options["task"];
188
+		Debug::log("Using task id ".$options["task"]);
189
+		$lock_filename = $lock_filename."-task_".$options["task"];
190 190
 	}
191 191
 
192 192
 	if (isset($options["pidlock"])) {
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 	if (isset($options["force-update"])) {
216 216
 		Debug::log("marking all feeds as needing update...");
217 217
 
218
-		$pdo->query( "UPDATE ttrss_feeds SET
218
+		$pdo->query("UPDATE ttrss_feeds SET
219 219
           last_update_started = '1970-01-01', last_updated = '1970-01-01'");
220 220
 	}
221 221
 
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
             $log = isset($options['log']) ? '--log '.$options['log'] : '';
233 233
             $log_level = isset($options['log-level']) ? '--log-level '.$options['log-level'] : '';
234 234
 
235
-			passthru(PHP_EXECUTABLE . " " . $argv[0] ." --daemon-loop $quiet $log $log_level");
235
+			passthru(PHP_EXECUTABLE." ".$argv[0]." --daemon-loop $quiet $log $log_level");
236 236
 
237 237
 			// let's enforce a minimum spawn interval as to not forkbomb the host
238 238
 			$spawn_interval = max(60, DAEMON_SLEEP_INTERVAL);
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 	}
257 257
 
258 258
 	if (isset($options["cleanup-tags"])) {
259
-		$rc = cleanup_tags( 14, 50000);
259
+		$rc = cleanup_tags(14, 50000);
260 260
 		Debug::log("$rc tags deleted.\n");
261 261
 	}
262 262
 
@@ -270,18 +270,18 @@  discard block
 block discarded – undo
270 270
 		Debug::log("clearing existing indexes...");
271 271
 
272 272
 		if (DB_TYPE == "pgsql") {
273
-			$sth = $pdo->query( "SELECT relname FROM
273
+			$sth = $pdo->query("SELECT relname FROM
274 274
 				pg_catalog.pg_class WHERE relname LIKE 'ttrss_%'
275 275
 					AND relname NOT LIKE '%_pkey'
276 276
 				AND relkind = 'i'");
277 277
 		} else {
278
-			$sth = $pdo->query( "SELECT index_name,table_name FROM
278
+			$sth = $pdo->query("SELECT index_name,table_name FROM
279 279
 				information_schema.statistics WHERE index_name LIKE 'ttrss_%'");
280 280
 		}
281 281
 
282 282
 		while ($line = $sth->fetch()) {
283 283
 			if (DB_TYPE == "pgsql") {
284
-				$statement = "DROP INDEX " . $line["relname"];
284
+				$statement = "DROP INDEX ".$line["relname"];
285 285
 				Debug::log($statement);
286 286
 			} else {
287 287
 				$statement = "ALTER TABLE ".
@@ -291,9 +291,9 @@  discard block
 block discarded – undo
291 291
 			$pdo->query($statement);
292 292
 		}
293 293
 
294
-		Debug::log("reading indexes from schema for: " . DB_TYPE);
294
+		Debug::log("reading indexes from schema for: ".DB_TYPE);
295 295
 
296
-		$fp = fopen("schema/ttrss_schema_" . DB_TYPE . ".sql", "r");
296
+		$fp = fopen("schema/ttrss_schema_".DB_TYPE.".sql", "r");
297 297
 		if ($fp) {
298 298
 			while ($line = fgets($fp)) {
299 299
 				$matches = array();
@@ -336,9 +336,9 @@  discard block
 block discarded – undo
336 336
 				$filter = array();
337 337
 
338 338
 				if (sql_bool_to_bool($line["cat_filter"])) {
339
-					$feed_id = "CAT:" . (int)$line["cat_id"];
339
+					$feed_id = "CAT:".(int) $line["cat_id"];
340 340
 				} else {
341
-					$feed_id = (int)$line["feed_id"];
341
+					$feed_id = (int) $line["feed_id"];
342 342
 				}
343 343
 
344 344
 				$filter["enabled"] = $line["enabled"] ? "on" : "off";
@@ -367,12 +367,12 @@  discard block
 block discarded – undo
367 367
 	}
368 368
 
369 369
 	if (isset($options["update-schema"])) {
370
-		Debug::log("Checking for updates (" . DB_TYPE . ")...");
370
+		Debug::log("Checking for updates (".DB_TYPE.")...");
371 371
 
372 372
 		$updater = new DbUpdater(DB_TYPE, SCHEMA_VERSION);
373 373
 
374 374
 		if ($updater->isUpdateRequired()) {
375
-			Debug::log("Schema update required, version " . $updater->getSchemaVersion() . " to " . SCHEMA_VERSION);
375
+			Debug::log("Schema update required, version ".$updater->getSchemaVersion()." to ".SCHEMA_VERSION);
376 376
 
377 377
 			if (DB_TYPE == "mysql")
378 378
 				Debug::Log("READ THIS: Due to MySQL limitations, your database is not completely protected while updating.\n".
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
 			if (read_stdin() != 'yes')
386 386
 				exit;
387 387
 
388
-			Debug::log("Performing updates to version " . SCHEMA_VERSION);
388
+			Debug::log("Performing updates to version ".SCHEMA_VERSION);
389 389
 
390 390
 			for ($i = $updater->getSchemaVersion() + 1; $i <= SCHEMA_VERSION; $i++) {
391 391
 				Debug::log("* Updating to version $i...");
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
 		while (true) {
429 429
 
430 430
 			while ($line = $sth->fetch()) {
431
-				$tsvector_combined = mb_substr(strip_tags($line["title"] . " " . $line["content"]), 0, 1000000);
431
+				$tsvector_combined = mb_substr(strip_tags($line["title"]." ".$line["content"]), 0, 1000000);
432 432
 
433 433
 				$usth->execute([$tsvector_combined, $line['id']]);
434 434
 
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
 
486 486
 	PluginHost::getInstance()->run_commands($options);
487 487
 
488
-	if (file_exists(LOCK_DIRECTORY . "/$lock_filename"))
488
+	if (file_exists(LOCK_DIRECTORY."/$lock_filename"))
489 489
 		if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN')
490 490
 			fclose($lock_handle);
491
-		unlink(LOCK_DIRECTORY . "/$lock_filename");
491
+		unlink(LOCK_DIRECTORY."/$lock_filename");
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -435,7 +435,7 @@
 block discarded – undo
435 435
 				$processed++;
436 436
 			}
437 437
 
438
-			print "Processed $processed articles...\n";
438
+			print "processed $processed articles...\n";
439 439
 
440 440
 			if ($processed < $limit) {
441 441
 				echo "All done.\n";
Please login to merge, or discard this patch.
Indentation   +363 added lines, -363 removed lines patch added patch discarded remove patch
@@ -1,107 +1,107 @@  discard block
 block discarded – undo
1 1
 #!/usr/bin/env php
2 2
 <?php
3
-	set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR .
4
-		get_include_path());
3
+    set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR .
4
+        get_include_path());
5 5
 
6
-	define('DISABLE_SESSIONS', true);
6
+    define('DISABLE_SESSIONS', true);
7 7
 
8
-	chdir(dirname(__FILE__));
8
+    chdir(dirname(__FILE__));
9 9
 
10
-	require_once "autoload.php";
11
-	require_once "functions.php";
12
-	require_once "config.php";
13
-	require_once "sanity_check.php";
14
-	require_once "db.php";
15
-	require_once "db-prefs.php";
10
+    require_once "autoload.php";
11
+    require_once "functions.php";
12
+    require_once "config.php";
13
+    require_once "sanity_check.php";
14
+    require_once "db.php";
15
+    require_once "db-prefs.php";
16 16
 
17
-	function cleanup_tags($days = 14, $limit = 1000) {
17
+    function cleanup_tags($days = 14, $limit = 1000) {
18 18
 
19
-		$days = (int) $days;
19
+        $days = (int) $days;
20 20
 
21
-		if (DB_TYPE == "pgsql") {
22
-			$interval_query = "date_updated < NOW() - INTERVAL '$days days'";
23
-		} else if (DB_TYPE == "mysql") {
24
-			$interval_query = "date_updated < DATE_SUB(NOW(), INTERVAL $days DAY)";
25
-		}
21
+        if (DB_TYPE == "pgsql") {
22
+            $interval_query = "date_updated < NOW() - INTERVAL '$days days'";
23
+        } else if (DB_TYPE == "mysql") {
24
+            $interval_query = "date_updated < DATE_SUB(NOW(), INTERVAL $days DAY)";
25
+        }
26 26
 
27
-		$tags_deleted = 0;
27
+        $tags_deleted = 0;
28 28
 
29
-		$pdo = Db::pdo();
29
+        $pdo = Db::pdo();
30 30
 
31
-		while ($limit > 0) {
32
-			$limit_part = 500;
31
+        while ($limit > 0) {
32
+            $limit_part = 500;
33 33
 
34
-			$sth = $pdo->prepare("SELECT ttrss_tags.id AS id
34
+            $sth = $pdo->prepare("SELECT ttrss_tags.id AS id
35 35
 						FROM ttrss_tags, ttrss_user_entries, ttrss_entries
36 36
 						WHERE post_int_id = int_id AND $interval_query AND
37 37
 						ref_id = ttrss_entries.id AND tag_cache != '' LIMIT ?");
38
-			$sth->bindValue(1, $limit_part, PDO::PARAM_INT);
39
-			$sth->execute();
40
-
41
-			$ids = array();
42
-
43
-			while ($line = $sth->fetch()) {
44
-				array_push($ids, $line['id']);
45
-			}
46
-
47
-			if (count($ids) > 0) {
48
-				$ids = join(",", $ids);
49
-
50
-				$usth = $pdo->query("DELETE FROM ttrss_tags WHERE id IN ($ids)");
51
-				$tags_deleted = $usth->rowCount();
52
-			} else {
53
-				break;
54
-			}
55
-
56
-			$limit -= $limit_part;
57
-		}
58
-
59
-		return $tags_deleted;
60
-	}
61
-
62
-	if (!defined('PHP_EXECUTABLE'))
63
-		define('PHP_EXECUTABLE', '/usr/bin/php');
64
-
65
-	$pdo = Db::pdo();
66
-
67
-	init_plugins();
68
-
69
-	$longopts = array("feeds",
70
-			"daemon",
71
-			"daemon-loop",
72
-			"send-digests",
73
-			"task:",
74
-			"cleanup-tags",
75
-			"quiet",
76
-			"log:",
77
-			"log-level:",
78
-			"indexes",
79
-			"pidlock:",
80
-			"update-schema",
81
-			"convert-filters",
82
-			"force-update",
83
-			"gen-search-idx",
84
-			"list-plugins",
85
-			"debug-feed:",
86
-			"force-refetch",
87
-			"force-rehash",
88
-			"help");
89
-
90
-	foreach (PluginHost::getInstance()->get_commands() as $command => $data) {
91
-		array_push($longopts, $command . $data["suffix"]);
92
-	}
93
-
94
-	$options = getopt("", $longopts);
95
-
96
-	if (!is_array($options)) {
97
-		die("error: getopt() failed. ".
98
-			"Most probably you are using PHP CGI to run this script ".
99
-			"instead of required PHP CLI. Check tt-rss wiki page on updating feeds for ".
100
-			"additional information.\n");
101
-	}
102
-
103
-	if (count($options) == 0 && !defined('STDIN')) {
104
-		?>
38
+            $sth->bindValue(1, $limit_part, PDO::PARAM_INT);
39
+            $sth->execute();
40
+
41
+            $ids = array();
42
+
43
+            while ($line = $sth->fetch()) {
44
+                array_push($ids, $line['id']);
45
+            }
46
+
47
+            if (count($ids) > 0) {
48
+                $ids = join(",", $ids);
49
+
50
+                $usth = $pdo->query("DELETE FROM ttrss_tags WHERE id IN ($ids)");
51
+                $tags_deleted = $usth->rowCount();
52
+            } else {
53
+                break;
54
+            }
55
+
56
+            $limit -= $limit_part;
57
+        }
58
+
59
+        return $tags_deleted;
60
+    }
61
+
62
+    if (!defined('PHP_EXECUTABLE'))
63
+        define('PHP_EXECUTABLE', '/usr/bin/php');
64
+
65
+    $pdo = Db::pdo();
66
+
67
+    init_plugins();
68
+
69
+    $longopts = array("feeds",
70
+            "daemon",
71
+            "daemon-loop",
72
+            "send-digests",
73
+            "task:",
74
+            "cleanup-tags",
75
+            "quiet",
76
+            "log:",
77
+            "log-level:",
78
+            "indexes",
79
+            "pidlock:",
80
+            "update-schema",
81
+            "convert-filters",
82
+            "force-update",
83
+            "gen-search-idx",
84
+            "list-plugins",
85
+            "debug-feed:",
86
+            "force-refetch",
87
+            "force-rehash",
88
+            "help");
89
+
90
+    foreach (PluginHost::getInstance()->get_commands() as $command => $data) {
91
+        array_push($longopts, $command . $data["suffix"]);
92
+    }
93
+
94
+    $options = getopt("", $longopts);
95
+
96
+    if (!is_array($options)) {
97
+        die("error: getopt() failed. ".
98
+            "Most probably you are using PHP CGI to run this script ".
99
+            "instead of required PHP CLI. Check tt-rss wiki page on updating feeds for ".
100
+            "additional information.\n");
101
+    }
102
+
103
+    if (count($options) == 0 && !defined('STDIN')) {
104
+        ?>
105 105
 		<!DOCTYPE html>
106 106
 		<html>
107 107
 		<head>
@@ -116,376 +116,376 @@  discard block
 block discarded – undo
116 116
 
117 117
 		</body></html>
118 118
 	<?php
119
-		exit;
120
-	}
121
-
122
-	if (count($options) == 0 || isset($options["help"]) ) {
123
-		print "Tiny Tiny RSS data update script.\n\n";
124
-		print "Options:\n";
125
-		print "  --feeds              - update feeds\n";
126
-		print "  --daemon             - start single-process update daemon\n";
127
-		print "  --task N             - create lockfile using this task id\n";
128
-		print "  --cleanup-tags       - perform tags table maintenance\n";
129
-		print "  --quiet              - don't output messages to stdout\n";
130
-		print "  --log FILE           - log messages to FILE\n";
131
-		print "  --log-level N        - log verbosity level\n";
132
-		print "  --indexes            - recreate missing schema indexes\n";
133
-		print "  --update-schema      - update database schema\n";
134
-		print "  --gen-search-idx     - generate basic PostgreSQL fulltext search index\n";
135
-		print "  --convert-filters    - convert type1 filters to type2\n";
136
-		print "  --send-digests       - send pending email digests\n";
137
-		print "  --force-update       - force update of all feeds\n";
138
-		print "  --list-plugins       - list all available plugins\n";
139
-		print "  --debug-feed N       - perform debug update of feed N\n";
140
-		print "  --force-refetch      - debug update: force refetch feed data\n";
141
-		print "  --force-rehash       - debug update: force rehash articles\n";
142
-		print "  --help               - show this help\n";
143
-		print "Plugin options:\n";
144
-
145
-		foreach (PluginHost::getInstance()->get_commands() as $command => $data) {
146
-			$args = $data['arghelp'];
147
-			printf(" --%-19s - %s\n", "$command $args", $data["description"]);
148
-		}
149
-
150
-		return;
151
-	}
152
-
153
-	if (!isset($options['daemon'])) {
154
-		require_once "errorhandler.php";
155
-	}
156
-
157
-	if (!isset($options['update-schema'])) {
158
-		$schema_version = get_schema_version();
159
-
160
-		if ($schema_version != SCHEMA_VERSION) {
161
-			die("Schema version is wrong, please upgrade the database (--update-schema).\n");
162
-		}
163
-	}
164
-
165
-	Debug::set_enabled(true);
166
-
167
-	if (isset($options["log-level"])) {
168
-	    Debug::set_loglevel((int)$options["log-level"]);
119
+        exit;
120
+    }
121
+
122
+    if (count($options) == 0 || isset($options["help"]) ) {
123
+        print "Tiny Tiny RSS data update script.\n\n";
124
+        print "Options:\n";
125
+        print "  --feeds              - update feeds\n";
126
+        print "  --daemon             - start single-process update daemon\n";
127
+        print "  --task N             - create lockfile using this task id\n";
128
+        print "  --cleanup-tags       - perform tags table maintenance\n";
129
+        print "  --quiet              - don't output messages to stdout\n";
130
+        print "  --log FILE           - log messages to FILE\n";
131
+        print "  --log-level N        - log verbosity level\n";
132
+        print "  --indexes            - recreate missing schema indexes\n";
133
+        print "  --update-schema      - update database schema\n";
134
+        print "  --gen-search-idx     - generate basic PostgreSQL fulltext search index\n";
135
+        print "  --convert-filters    - convert type1 filters to type2\n";
136
+        print "  --send-digests       - send pending email digests\n";
137
+        print "  --force-update       - force update of all feeds\n";
138
+        print "  --list-plugins       - list all available plugins\n";
139
+        print "  --debug-feed N       - perform debug update of feed N\n";
140
+        print "  --force-refetch      - debug update: force refetch feed data\n";
141
+        print "  --force-rehash       - debug update: force rehash articles\n";
142
+        print "  --help               - show this help\n";
143
+        print "Plugin options:\n";
144
+
145
+        foreach (PluginHost::getInstance()->get_commands() as $command => $data) {
146
+            $args = $data['arghelp'];
147
+            printf(" --%-19s - %s\n", "$command $args", $data["description"]);
148
+        }
149
+
150
+        return;
151
+    }
152
+
153
+    if (!isset($options['daemon'])) {
154
+        require_once "errorhandler.php";
155
+    }
156
+
157
+    if (!isset($options['update-schema'])) {
158
+        $schema_version = get_schema_version();
159
+
160
+        if ($schema_version != SCHEMA_VERSION) {
161
+            die("Schema version is wrong, please upgrade the database (--update-schema).\n");
162
+        }
163
+    }
164
+
165
+    Debug::set_enabled(true);
166
+
167
+    if (isset($options["log-level"])) {
168
+        Debug::set_loglevel((int)$options["log-level"]);
169 169
     }
170 170
 
171
-	if (isset($options["log"])) {
172
-		Debug::set_quiet(isset($options['quiet']));
173
-		Debug::set_logfile($options["log"]);
171
+    if (isset($options["log"])) {
172
+        Debug::set_quiet(isset($options['quiet']));
173
+        Debug::set_logfile($options["log"]);
174 174
         Debug::log("Logging to " . $options["log"]);
175 175
     } else {
176
-	    if (isset($options['quiet'])) {
177
-			Debug::set_loglevel(Debug::$LOG_DISABLED);
176
+        if (isset($options['quiet'])) {
177
+            Debug::set_loglevel(Debug::$LOG_DISABLED);
178 178
         }
179 179
     }
180 180
 
181
-	if (!isset($options["daemon"])) {
182
-		$lock_filename = "update.lock";
183
-	} else {
184
-		$lock_filename = "update_daemon.lock";
185
-	}
181
+    if (!isset($options["daemon"])) {
182
+        $lock_filename = "update.lock";
183
+    } else {
184
+        $lock_filename = "update_daemon.lock";
185
+    }
186 186
 
187
-	if (isset($options["task"])) {
188
-		Debug::log("Using task id " . $options["task"]);
189
-		$lock_filename = $lock_filename . "-task_" . $options["task"];
190
-	}
187
+    if (isset($options["task"])) {
188
+        Debug::log("Using task id " . $options["task"]);
189
+        $lock_filename = $lock_filename . "-task_" . $options["task"];
190
+    }
191 191
 
192
-	if (isset($options["pidlock"])) {
193
-		$my_pid = $options["pidlock"];
194
-		$lock_filename = "update_daemon-$my_pid.lock";
192
+    if (isset($options["pidlock"])) {
193
+        $my_pid = $options["pidlock"];
194
+        $lock_filename = "update_daemon-$my_pid.lock";
195 195
 
196
-	}
196
+    }
197 197
 
198
-	Debug::log("Lock: $lock_filename");
198
+    Debug::log("Lock: $lock_filename");
199 199
 
200
-	$lock_handle = make_lockfile($lock_filename);
201
-	$must_exit = false;
200
+    $lock_handle = make_lockfile($lock_filename);
201
+    $must_exit = false;
202 202
 
203
-	if (isset($options["task"]) && isset($options["pidlock"])) {
204
-		$waits = $options["task"] * 5;
205
-		Debug::log("Waiting before update ($waits)");
206
-		sleep($waits);
207
-	}
203
+    if (isset($options["task"]) && isset($options["pidlock"])) {
204
+        $waits = $options["task"] * 5;
205
+        Debug::log("Waiting before update ($waits)");
206
+        sleep($waits);
207
+    }
208 208
 
209
-	// Try to lock a file in order to avoid concurrent update.
210
-	if (!$lock_handle) {
211
-		die("error: Can't create lockfile ($lock_filename). ".
212
-			"Maybe another update process is already running.\n");
213
-	}
209
+    // Try to lock a file in order to avoid concurrent update.
210
+    if (!$lock_handle) {
211
+        die("error: Can't create lockfile ($lock_filename). ".
212
+            "Maybe another update process is already running.\n");
213
+    }
214 214
 
215
-	if (isset($options["force-update"])) {
216
-		Debug::log("marking all feeds as needing update...");
215
+    if (isset($options["force-update"])) {
216
+        Debug::log("marking all feeds as needing update...");
217 217
 
218
-		$pdo->query( "UPDATE ttrss_feeds SET
218
+        $pdo->query( "UPDATE ttrss_feeds SET
219 219
           last_update_started = '1970-01-01', last_updated = '1970-01-01'");
220
-	}
220
+    }
221 221
 
222
-	if (isset($options["feeds"])) {
223
-		RSSUtils::update_daemon_common();
224
-		RSSUtils::housekeeping_common(true);
222
+    if (isset($options["feeds"])) {
223
+        RSSUtils::update_daemon_common();
224
+        RSSUtils::housekeeping_common(true);
225 225
 
226
-		PluginHost::getInstance()->run_hooks(PluginHost::HOOK_UPDATE_TASK, "hook_update_task", $op);
227
-	}
226
+        PluginHost::getInstance()->run_hooks(PluginHost::HOOK_UPDATE_TASK, "hook_update_task", $op);
227
+    }
228 228
 
229
-	if (isset($options["daemon"])) {
230
-		while (true) {
231
-			$quiet = (isset($options["quiet"])) ? "--quiet" : "";
229
+    if (isset($options["daemon"])) {
230
+        while (true) {
231
+            $quiet = (isset($options["quiet"])) ? "--quiet" : "";
232 232
             $log = isset($options['log']) ? '--log '.$options['log'] : '';
233 233
             $log_level = isset($options['log-level']) ? '--log-level '.$options['log-level'] : '';
234 234
 
235
-			passthru(PHP_EXECUTABLE . " " . $argv[0] ." --daemon-loop $quiet $log $log_level");
235
+            passthru(PHP_EXECUTABLE . " " . $argv[0] ." --daemon-loop $quiet $log $log_level");
236 236
 
237
-			// let's enforce a minimum spawn interval as to not forkbomb the host
238
-			$spawn_interval = max(60, DAEMON_SLEEP_INTERVAL);
237
+            // let's enforce a minimum spawn interval as to not forkbomb the host
238
+            $spawn_interval = max(60, DAEMON_SLEEP_INTERVAL);
239 239
 
240
-			Debug::log("Sleeping for $spawn_interval seconds...");
241
-			sleep($spawn_interval);
242
-		}
243
-	}
240
+            Debug::log("Sleeping for $spawn_interval seconds...");
241
+            sleep($spawn_interval);
242
+        }
243
+    }
244 244
 
245
-	if (isset($options["daemon-loop"])) {
246
-		if (!make_stampfile('update_daemon.stamp')) {
247
-			Debug::log("warning: unable to create stampfile\n");
248
-		}
245
+    if (isset($options["daemon-loop"])) {
246
+        if (!make_stampfile('update_daemon.stamp')) {
247
+            Debug::log("warning: unable to create stampfile\n");
248
+        }
249 249
 
250
-		RSSUtils::update_daemon_common(isset($options["pidlock"]) ? 50 : DAEMON_FEED_LIMIT);
250
+        RSSUtils::update_daemon_common(isset($options["pidlock"]) ? 50 : DAEMON_FEED_LIMIT);
251 251
 
252
-		if (!isset($options["pidlock"]) || $options["task"] == 0)
253
-			RSSUtils::housekeeping_common(true);
252
+        if (!isset($options["pidlock"]) || $options["task"] == 0)
253
+            RSSUtils::housekeeping_common(true);
254 254
 
255
-		PluginHost::getInstance()->run_hooks(PluginHost::HOOK_UPDATE_TASK, "hook_update_task", $op);
256
-	}
255
+        PluginHost::getInstance()->run_hooks(PluginHost::HOOK_UPDATE_TASK, "hook_update_task", $op);
256
+    }
257 257
 
258
-	if (isset($options["cleanup-tags"])) {
259
-		$rc = cleanup_tags( 14, 50000);
260
-		Debug::log("$rc tags deleted.\n");
261
-	}
258
+    if (isset($options["cleanup-tags"])) {
259
+        $rc = cleanup_tags( 14, 50000);
260
+        Debug::log("$rc tags deleted.\n");
261
+    }
262 262
 
263
-	if (isset($options["indexes"])) {
264
-		Debug::log("PLEASE BACKUP YOUR DATABASE BEFORE PROCEEDING!");
265
-		Debug::log("Type 'yes' to continue.");
263
+    if (isset($options["indexes"])) {
264
+        Debug::log("PLEASE BACKUP YOUR DATABASE BEFORE PROCEEDING!");
265
+        Debug::log("Type 'yes' to continue.");
266 266
 
267
-		if (read_stdin() != 'yes')
268
-			exit;
267
+        if (read_stdin() != 'yes')
268
+            exit;
269 269
 
270
-		Debug::log("clearing existing indexes...");
270
+        Debug::log("clearing existing indexes...");
271 271
 
272
-		if (DB_TYPE == "pgsql") {
273
-			$sth = $pdo->query( "SELECT relname FROM
272
+        if (DB_TYPE == "pgsql") {
273
+            $sth = $pdo->query( "SELECT relname FROM
274 274
 				pg_catalog.pg_class WHERE relname LIKE 'ttrss_%'
275 275
 					AND relname NOT LIKE '%_pkey'
276 276
 				AND relkind = 'i'");
277
-		} else {
278
-			$sth = $pdo->query( "SELECT index_name,table_name FROM
277
+        } else {
278
+            $sth = $pdo->query( "SELECT index_name,table_name FROM
279 279
 				information_schema.statistics WHERE index_name LIKE 'ttrss_%'");
280
-		}
281
-
282
-		while ($line = $sth->fetch()) {
283
-			if (DB_TYPE == "pgsql") {
284
-				$statement = "DROP INDEX " . $line["relname"];
285
-				Debug::log($statement);
286
-			} else {
287
-				$statement = "ALTER TABLE ".
288
-					$line['table_name']." DROP INDEX ".$line['index_name'];
289
-				Debug::log($statement);
290
-			}
291
-			$pdo->query($statement);
292
-		}
280
+        }
293 281
 
294
-		Debug::log("reading indexes from schema for: " . DB_TYPE);
282
+        while ($line = $sth->fetch()) {
283
+            if (DB_TYPE == "pgsql") {
284
+                $statement = "DROP INDEX " . $line["relname"];
285
+                Debug::log($statement);
286
+            } else {
287
+                $statement = "ALTER TABLE ".
288
+                    $line['table_name']." DROP INDEX ".$line['index_name'];
289
+                Debug::log($statement);
290
+            }
291
+            $pdo->query($statement);
292
+        }
295 293
 
296
-		$fp = fopen("schema/ttrss_schema_" . DB_TYPE . ".sql", "r");
297
-		if ($fp) {
298
-			while ($line = fgets($fp)) {
299
-				$matches = array();
294
+        Debug::log("reading indexes from schema for: " . DB_TYPE);
300 295
 
301
-				if (preg_match("/^create index ([^ ]+) on ([^ ]+)$/i", $line, $matches)) {
302
-					$index = $matches[1];
303
-					$table = $matches[2];
296
+        $fp = fopen("schema/ttrss_schema_" . DB_TYPE . ".sql", "r");
297
+        if ($fp) {
298
+            while ($line = fgets($fp)) {
299
+                $matches = array();
304 300
 
305
-					$statement = "CREATE INDEX $index ON $table";
301
+                if (preg_match("/^create index ([^ ]+) on ([^ ]+)$/i", $line, $matches)) {
302
+                    $index = $matches[1];
303
+                    $table = $matches[2];
306 304
 
307
-					Debug::log($statement);
308
-					$pdo->query($statement);
309
-				}
310
-			}
311
-			fclose($fp);
312
-		} else {
313
-			Debug::log("unable to open schema file.");
314
-		}
315
-		Debug::log("all done.");
316
-	}
305
+                    $statement = "CREATE INDEX $index ON $table";
317 306
 
318
-	if (isset($options["convert-filters"])) {
319
-		Debug::log("WARNING: this will remove all existing type2 filters.");
320
-		Debug::log("Type 'yes' to continue.");
307
+                    Debug::log($statement);
308
+                    $pdo->query($statement);
309
+                }
310
+            }
311
+            fclose($fp);
312
+        } else {
313
+            Debug::log("unable to open schema file.");
314
+        }
315
+        Debug::log("all done.");
316
+    }
321 317
 
322
-		if (read_stdin() != 'yes')
323
-			exit;
318
+    if (isset($options["convert-filters"])) {
319
+        Debug::log("WARNING: this will remove all existing type2 filters.");
320
+        Debug::log("Type 'yes' to continue.");
324 321
 
325
-		Debug::log("converting filters...");
322
+        if (read_stdin() != 'yes')
323
+            exit;
326 324
 
327
-		$pdo->query("DELETE FROM ttrss_filters2");
325
+        Debug::log("converting filters...");
328 326
 
329
-		$res = $pdo->query("SELECT * FROM ttrss_filters ORDER BY id");
327
+        $pdo->query("DELETE FROM ttrss_filters2");
330 328
 
331
-		while ($line = $res->fetch()) {
332
-			$owner_uid = $line["owner_uid"];
329
+        $res = $pdo->query("SELECT * FROM ttrss_filters ORDER BY id");
333 330
 
334
-			// date filters are removed
335
-			if ($line["filter_type"] != 5) {
336
-				$filter = array();
331
+        while ($line = $res->fetch()) {
332
+            $owner_uid = $line["owner_uid"];
337 333
 
338
-				if (sql_bool_to_bool($line["cat_filter"])) {
339
-					$feed_id = "CAT:" . (int)$line["cat_id"];
340
-				} else {
341
-					$feed_id = (int)$line["feed_id"];
342
-				}
334
+            // date filters are removed
335
+            if ($line["filter_type"] != 5) {
336
+                $filter = array();
343 337
 
344
-				$filter["enabled"] = $line["enabled"] ? "on" : "off";
345
-				$filter["rule"] = array(
346
-					json_encode(array(
347
-						"reg_exp" => $line["reg_exp"],
348
-						"feed_id" => $feed_id,
349
-						"filter_type" => $line["filter_type"])));
338
+                if (sql_bool_to_bool($line["cat_filter"])) {
339
+                    $feed_id = "CAT:" . (int)$line["cat_id"];
340
+                } else {
341
+                    $feed_id = (int)$line["feed_id"];
342
+                }
350 343
 
351
-				$filter["action"] = array(
352
-					json_encode(array(
353
-						"action_id" => $line["action_id"],
354
-						"action_param_label" => $line["action_param"],
355
-						"action_param" => $line["action_param"])));
344
+                $filter["enabled"] = $line["enabled"] ? "on" : "off";
345
+                $filter["rule"] = array(
346
+                    json_encode(array(
347
+                        "reg_exp" => $line["reg_exp"],
348
+                        "feed_id" => $feed_id,
349
+                        "filter_type" => $line["filter_type"])));
356 350
 
357
-				// Oh god it's full of hacks
351
+                $filter["action"] = array(
352
+                    json_encode(array(
353
+                        "action_id" => $line["action_id"],
354
+                        "action_param_label" => $line["action_param"],
355
+                        "action_param" => $line["action_param"])));
358 356
 
359
-				$_REQUEST = $filter;
360
-				$_SESSION["uid"] = $owner_uid;
357
+                // Oh god it's full of hacks
361 358
 
362
-				$filters = new Pref_Filters($_REQUEST);
363
-				$filters->add();
364
-			}
365
-		}
359
+                $_REQUEST = $filter;
360
+                $_SESSION["uid"] = $owner_uid;
366 361
 
367
-	}
362
+                $filters = new Pref_Filters($_REQUEST);
363
+                $filters->add();
364
+            }
365
+        }
368 366
 
369
-	if (isset($options["update-schema"])) {
370
-		Debug::log("Checking for updates (" . DB_TYPE . ")...");
367
+    }
368
+
369
+    if (isset($options["update-schema"])) {
370
+        Debug::log("Checking for updates (" . DB_TYPE . ")...");
371 371
 
372
-		$updater = new DbUpdater(DB_TYPE, SCHEMA_VERSION);
372
+        $updater = new DbUpdater(DB_TYPE, SCHEMA_VERSION);
373 373
 
374
-		if ($updater->isUpdateRequired()) {
375
-			Debug::log("Schema update required, version " . $updater->getSchemaVersion() . " to " . SCHEMA_VERSION);
374
+        if ($updater->isUpdateRequired()) {
375
+            Debug::log("Schema update required, version " . $updater->getSchemaVersion() . " to " . SCHEMA_VERSION);
376 376
 
377
-			if (DB_TYPE == "mysql")
378
-				Debug::Log("READ THIS: Due to MySQL limitations, your database is not completely protected while updating.\n".
379
-					"Errors may put it in an inconsistent state requiring manual rollback.\nBACKUP YOUR DATABASE BEFORE CONTINUING.");
380
-			else
381
-				Debug::log("WARNING: please backup your database before continuing.");
377
+            if (DB_TYPE == "mysql")
378
+                Debug::Log("READ THIS: Due to MySQL limitations, your database is not completely protected while updating.\n".
379
+                    "Errors may put it in an inconsistent state requiring manual rollback.\nBACKUP YOUR DATABASE BEFORE CONTINUING.");
380
+            else
381
+                Debug::log("WARNING: please backup your database before continuing.");
382 382
 
383
-			Debug::log("Type 'yes' to continue.");
383
+            Debug::log("Type 'yes' to continue.");
384 384
 
385
-			if (read_stdin() != 'yes')
386
-				exit;
385
+            if (read_stdin() != 'yes')
386
+                exit;
387 387
 
388
-			Debug::log("Performing updates to version " . SCHEMA_VERSION);
388
+            Debug::log("Performing updates to version " . SCHEMA_VERSION);
389 389
 
390
-			for ($i = $updater->getSchemaVersion() + 1; $i <= SCHEMA_VERSION; $i++) {
391
-				Debug::log("* Updating to version $i...");
390
+            for ($i = $updater->getSchemaVersion() + 1; $i <= SCHEMA_VERSION; $i++) {
391
+                Debug::log("* Updating to version $i...");
392 392
 
393
-				$result = $updater->performUpdateTo($i, false);
393
+                $result = $updater->performUpdateTo($i, false);
394 394
 
395
-				if ($result) {
396
-					Debug::log("* Completed.");
397
-				} else {
398
-					Debug::log("One of the updates failed. Either retry the process or perform updates manually.");
399
-					return;
400
-				}
395
+                if ($result) {
396
+                    Debug::log("* Completed.");
397
+                } else {
398
+                    Debug::log("One of the updates failed. Either retry the process or perform updates manually.");
399
+                    return;
400
+                }
401 401
 
402
-			}
403
-		} else {
404
-			Debug::log("Update not required.");
405
-		}
402
+            }
403
+        } else {
404
+            Debug::log("Update not required.");
405
+        }
406 406
 
407
-	}
407
+    }
408 408
 
409
-	if (isset($options["gen-search-idx"])) {
410
-		echo "Generating search index (stemming set to English)...\n";
409
+    if (isset($options["gen-search-idx"])) {
410
+        echo "Generating search index (stemming set to English)...\n";
411 411
 
412
-		$res = $pdo->query("SELECT COUNT(id) AS count FROM ttrss_entries WHERE tsvector_combined IS NULL");
413
-		$row = $res->fetch();
414
-		$count = $row['count'];
412
+        $res = $pdo->query("SELECT COUNT(id) AS count FROM ttrss_entries WHERE tsvector_combined IS NULL");
413
+        $row = $res->fetch();
414
+        $count = $row['count'];
415 415
 
416
-		print "Articles to process: $count.\n";
416
+        print "Articles to process: $count.\n";
417 417
 
418
-		$limit = 500;
419
-		$processed = 0;
418
+        $limit = 500;
419
+        $processed = 0;
420 420
 
421
-		$sth = $pdo->prepare("SELECT id, title, content FROM ttrss_entries WHERE
421
+        $sth = $pdo->prepare("SELECT id, title, content FROM ttrss_entries WHERE
422 422
           tsvector_combined IS NULL ORDER BY id LIMIT ?");
423
-		$sth->execute([$limit]);
423
+        $sth->execute([$limit]);
424 424
 
425
-		$usth = $pdo->prepare("UPDATE ttrss_entries
425
+        $usth = $pdo->prepare("UPDATE ttrss_entries
426 426
           SET tsvector_combined = to_tsvector('english', ?) WHERE id = ?");
427 427
 
428
-		while (true) {
428
+        while (true) {
429 429
 
430
-			while ($line = $sth->fetch()) {
431
-				$tsvector_combined = mb_substr(strip_tags($line["title"] . " " . $line["content"]), 0, 1000000);
430
+            while ($line = $sth->fetch()) {
431
+                $tsvector_combined = mb_substr(strip_tags($line["title"] . " " . $line["content"]), 0, 1000000);
432 432
 
433
-				$usth->execute([$tsvector_combined, $line['id']]);
433
+                $usth->execute([$tsvector_combined, $line['id']]);
434 434
 
435
-				$processed++;
436
-			}
435
+                $processed++;
436
+            }
437 437
 
438
-			print "Processed $processed articles...\n";
438
+            print "Processed $processed articles...\n";
439 439
 
440
-			if ($processed < $limit) {
441
-				echo "All done.\n";
442
-				break;
443
-			}
444
-		}
445
-	}
440
+            if ($processed < $limit) {
441
+                echo "All done.\n";
442
+                break;
443
+            }
444
+        }
445
+    }
446 446
 
447
-	if (isset($options["list-plugins"])) {
448
-		$tmppluginhost = new PluginHost();
449
-		$tmppluginhost->load_all($tmppluginhost::KIND_ALL, false);
450
-		$enabled = array_map("trim", explode(",", PLUGINS));
447
+    if (isset($options["list-plugins"])) {
448
+        $tmppluginhost = new PluginHost();
449
+        $tmppluginhost->load_all($tmppluginhost::KIND_ALL, false);
450
+        $enabled = array_map("trim", explode(",", PLUGINS));
451 451
 
452
-		echo "List of all available plugins:\n";
452
+        echo "List of all available plugins:\n";
453 453
 
454
-		foreach ($tmppluginhost->get_plugins() as $name => $plugin) {
455
-			$about = $plugin->about();
454
+        foreach ($tmppluginhost->get_plugins() as $name => $plugin) {
455
+            $about = $plugin->about();
456 456
 
457
-			$status = $about[3] ? "system" : "user";
457
+            $status = $about[3] ? "system" : "user";
458 458
 
459
-			if (in_array($name, $enabled)) $name .= "*";
459
+            if (in_array($name, $enabled)) $name .= "*";
460 460
 
461
-			printf("%-50s %-10s v%.2f (by %s)\n%s\n\n",
462
-				$name, $status, $about[0], $about[2], $about[1]);
463
-		}
461
+            printf("%-50s %-10s v%.2f (by %s)\n%s\n\n",
462
+                $name, $status, $about[0], $about[2], $about[1]);
463
+        }
464 464
 
465
-		echo "Plugins marked by * are currently enabled for all users.\n";
465
+        echo "Plugins marked by * are currently enabled for all users.\n";
466 466
 
467
-	}
467
+    }
468 468
 
469
-	if (isset($options["debug-feed"])) {
470
-		$feed = $options["debug-feed"];
469
+    if (isset($options["debug-feed"])) {
470
+        $feed = $options["debug-feed"];
471 471
 
472
-		if (isset($options["force-refetch"])) $_REQUEST["force_refetch"] = true;
473
-		if (isset($options["force-rehash"])) $_REQUEST["force_rehash"] = true;
472
+        if (isset($options["force-refetch"])) $_REQUEST["force_refetch"] = true;
473
+        if (isset($options["force-rehash"])) $_REQUEST["force_rehash"] = true;
474 474
 
475
-		Debug::set_loglevel(Debug::$LOG_EXTENDED);
475
+        Debug::set_loglevel(Debug::$LOG_EXTENDED);
476 476
 
477
-		$rc = RSSUtils::update_rss_feed($feed) != false ? 0 : 1;
477
+        $rc = RSSUtils::update_rss_feed($feed) != false ? 0 : 1;
478 478
 
479
-		exit($rc);
480
-	}
479
+        exit($rc);
480
+    }
481 481
 
482
-	if (isset($options["send-digests"])) {
483
-		Digest::send_headlines_digests();
484
-	}
482
+    if (isset($options["send-digests"])) {
483
+        Digest::send_headlines_digests();
484
+    }
485 485
 
486
-	PluginHost::getInstance()->run_commands($options);
486
+    PluginHost::getInstance()->run_commands($options);
487 487
 
488
-	if (file_exists(LOCK_DIRECTORY . "/$lock_filename"))
489
-		if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN')
490
-			fclose($lock_handle);
491
-		unlink(LOCK_DIRECTORY . "/$lock_filename");
488
+    if (file_exists(LOCK_DIRECTORY . "/$lock_filename"))
489
+        if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN')
490
+            fclose($lock_handle);
491
+        unlink(LOCK_DIRECTORY . "/$lock_filename");
Please login to merge, or discard this patch.
Braces   +32 added lines, -19 removed lines patch added patch discarded remove patch
@@ -59,8 +59,9 @@  discard block
 block discarded – undo
59 59
 		return $tags_deleted;
60 60
 	}
61 61
 
62
-	if (!defined('PHP_EXECUTABLE'))
63
-		define('PHP_EXECUTABLE', '/usr/bin/php');
62
+	if (!defined('PHP_EXECUTABLE')) {
63
+			define('PHP_EXECUTABLE', '/usr/bin/php');
64
+	}
64 65
 
65 66
 	$pdo = Db::pdo();
66 67
 
@@ -249,8 +250,9 @@  discard block
 block discarded – undo
249 250
 
250 251
 		RSSUtils::update_daemon_common(isset($options["pidlock"]) ? 50 : DAEMON_FEED_LIMIT);
251 252
 
252
-		if (!isset($options["pidlock"]) || $options["task"] == 0)
253
-			RSSUtils::housekeeping_common(true);
253
+		if (!isset($options["pidlock"]) || $options["task"] == 0) {
254
+					RSSUtils::housekeeping_common(true);
255
+		}
254 256
 
255 257
 		PluginHost::getInstance()->run_hooks(PluginHost::HOOK_UPDATE_TASK, "hook_update_task", $op);
256 258
 	}
@@ -264,8 +266,9 @@  discard block
 block discarded – undo
264 266
 		Debug::log("PLEASE BACKUP YOUR DATABASE BEFORE PROCEEDING!");
265 267
 		Debug::log("Type 'yes' to continue.");
266 268
 
267
-		if (read_stdin() != 'yes')
268
-			exit;
269
+		if (read_stdin() != 'yes') {
270
+					exit;
271
+		}
269 272
 
270 273
 		Debug::log("clearing existing indexes...");
271 274
 
@@ -319,8 +322,9 @@  discard block
 block discarded – undo
319 322
 		Debug::log("WARNING: this will remove all existing type2 filters.");
320 323
 		Debug::log("Type 'yes' to continue.");
321 324
 
322
-		if (read_stdin() != 'yes')
323
-			exit;
325
+		if (read_stdin() != 'yes') {
326
+					exit;
327
+		}
324 328
 
325 329
 		Debug::log("converting filters...");
326 330
 
@@ -374,16 +378,18 @@  discard block
 block discarded – undo
374 378
 		if ($updater->isUpdateRequired()) {
375 379
 			Debug::log("Schema update required, version " . $updater->getSchemaVersion() . " to " . SCHEMA_VERSION);
376 380
 
377
-			if (DB_TYPE == "mysql")
378
-				Debug::Log("READ THIS: Due to MySQL limitations, your database is not completely protected while updating.\n".
381
+			if (DB_TYPE == "mysql") {
382
+							Debug::Log("READ THIS: Due to MySQL limitations, your database is not completely protected while updating.\n".
379 383
 					"Errors may put it in an inconsistent state requiring manual rollback.\nBACKUP YOUR DATABASE BEFORE CONTINUING.");
380
-			else
381
-				Debug::log("WARNING: please backup your database before continuing.");
384
+			} else {
385
+							Debug::log("WARNING: please backup your database before continuing.");
386
+			}
382 387
 
383 388
 			Debug::log("Type 'yes' to continue.");
384 389
 
385
-			if (read_stdin() != 'yes')
386
-				exit;
390
+			if (read_stdin() != 'yes') {
391
+							exit;
392
+			}
387 393
 
388 394
 			Debug::log("Performing updates to version " . SCHEMA_VERSION);
389 395
 
@@ -456,7 +462,9 @@  discard block
 block discarded – undo
456 462
 
457 463
 			$status = $about[3] ? "system" : "user";
458 464
 
459
-			if (in_array($name, $enabled)) $name .= "*";
465
+			if (in_array($name, $enabled)) {
466
+			    $name .= "*";
467
+			}
460 468
 
461 469
 			printf("%-50s %-10s v%.2f (by %s)\n%s\n\n",
462 470
 				$name, $status, $about[0], $about[2], $about[1]);
@@ -469,8 +477,12 @@  discard block
 block discarded – undo
469 477
 	if (isset($options["debug-feed"])) {
470 478
 		$feed = $options["debug-feed"];
471 479
 
472
-		if (isset($options["force-refetch"])) $_REQUEST["force_refetch"] = true;
473
-		if (isset($options["force-rehash"])) $_REQUEST["force_rehash"] = true;
480
+		if (isset($options["force-refetch"])) {
481
+		    $_REQUEST["force_refetch"] = true;
482
+		}
483
+		if (isset($options["force-rehash"])) {
484
+		    $_REQUEST["force_rehash"] = true;
485
+		}
474 486
 
475 487
 		Debug::set_loglevel(Debug::$LOG_EXTENDED);
476 488
 
@@ -485,7 +497,8 @@  discard block
 block discarded – undo
485 497
 
486 498
 	PluginHost::getInstance()->run_commands($options);
487 499
 
488
-	if (file_exists(LOCK_DIRECTORY . "/$lock_filename"))
489
-		if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN')
500
+	if (file_exists(LOCK_DIRECTORY . "/$lock_filename")) {
501
+			if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN')
490 502
 			fclose($lock_handle);
503
+	}
491 504
 		unlink(LOCK_DIRECTORY . "/$lock_filename");
Please login to merge, or discard this patch.
include/login_form.php 2 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@
 block discarded – undo
92 92
 					   class="input input-text"
93 93
 					   value="<?php echo $_SESSION["fake_password"] ?>"/>
94 94
 			</fieldset>
95
-			<?php if (strpos(PLUGINS, "auth_internal") !== FALSE) { ?>
95
+			<?php if (strpos(PLUGINS, "auth_internal") !== false) { ?>
96 96
 				<fieldset class="align-right">
97 97
 					<a href="public.php?op=forgotpass"><?php echo __("I forgot my password") ?></a>
98 98
 				</fieldset>
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,15 +7,15 @@
 block discarded – undo
7 7
 	<link rel="shortcut icon" type="image/png" href="images/favicon.png">
8 8
 	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
9 9
 	<?php
10
-	foreach (array("lib/prototype.js",
11
-				"lib/dojo/dojo.js",
12
-				"lib/dojo/tt-rss-layer.js",
13
-				"js/common.js",
14
-				"errors.php?mode=js") as $jsfile) {
10
+    foreach (array("lib/prototype.js",
11
+                "lib/dojo/dojo.js",
12
+                "lib/dojo/tt-rss-layer.js",
13
+                "js/common.js",
14
+                "errors.php?mode=js") as $jsfile) {
15 15
 
16
-		echo javascript_tag($jsfile);
16
+        echo javascript_tag($jsfile);
17 17
 
18
-	} ?>
18
+    } ?>
19 19
 
20 20
 	<script type="text/javascript">
21 21
 		require({cache:{}});
Please login to merge, or discard this patch.
lib/phpqrcode/qrlib.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -25,19 +25,19 @@
 block discarded – undo
25 25
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 26
  */
27 27
 	
28
-	$QR_BASEDIR = dirname(__FILE__).DIRECTORY_SEPARATOR;
28
+    $QR_BASEDIR = dirname(__FILE__).DIRECTORY_SEPARATOR;
29 29
 	
30
-	// Required libs
30
+    // Required libs
31 31
 	
32
-	include $QR_BASEDIR."qrconst.php";
33
-	include $QR_BASEDIR."qrconfig.php";
34
-	include $QR_BASEDIR."qrtools.php";
35
-	include $QR_BASEDIR."qrspec.php";
36
-	include $QR_BASEDIR."qrimage.php";
37
-	include $QR_BASEDIR."qrinput.php";
38
-	include $QR_BASEDIR."qrbitstream.php";
39
-	include $QR_BASEDIR."qrsplit.php";
40
-	include $QR_BASEDIR."qrrscode.php";
41
-	include $QR_BASEDIR."qrmask.php";
42
-	include $QR_BASEDIR."qrencode.php";
32
+    include $QR_BASEDIR."qrconst.php";
33
+    include $QR_BASEDIR."qrconfig.php";
34
+    include $QR_BASEDIR."qrtools.php";
35
+    include $QR_BASEDIR."qrspec.php";
36
+    include $QR_BASEDIR."qrimage.php";
37
+    include $QR_BASEDIR."qrinput.php";
38
+    include $QR_BASEDIR."qrbitstream.php";
39
+    include $QR_BASEDIR."qrsplit.php";
40
+    include $QR_BASEDIR."qrrscode.php";
41
+    include $QR_BASEDIR."qrmask.php";
42
+    include $QR_BASEDIR."qrencode.php";
43 43
 
Please login to merge, or discard this patch.
lib/phpqrcode/tools/merged_header.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,4 +33,4 @@
 block discarded – undo
33 33
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
34 34
  */
35 35
  
36
- 
37 36
\ No newline at end of file
37
+    
38 38
\ No newline at end of file
Please login to merge, or discard this patch.