Browse Source

Whitespace cleanup

J. King 1 month ago
parent
commit
f64f0c6a22

+ 4
- 4
dist/nginx.conf View File

@@ -7,7 +7,7 @@ server {
7 7
     #auth_basic "Advanced RSS Environment";
8 8
     root /usr/share/arsse/www;
9 9
     index index.html;
10
-    
10
+
11 11
     location / {
12 12
         try_files $uri $uri/ =404;
13 13
     }
@@ -22,11 +22,11 @@ server {
22 22
         auth_basic off;
23 23
         include /usr/share/arsse/dist/nginx-fcgi.conf;
24 24
     }
25
-    
25
+
26 26
     # NextCloud News protocol
27 27
     location /index.php/apps/news/api {
28 28
         try_files $uri @arsse_auth;
29
-        
29
+
30 30
         location ~ ^/index\.php/apps/news/api/?$ {
31 31
             try_files $uri @arsse_no_auth;
32 32
         }
@@ -48,4 +48,4 @@ server {
48 48
         root /usr/share/arsse/www;
49 49
         try_files $uri =404;
50 50
     }
51
-}
51
+}

+ 1
- 1
lib/Arsse.php View File

@@ -8,7 +8,7 @@ namespace JKingWeb\Arsse;
8 8
 
9 9
 class Arsse {
10 10
     const VERSION = "0.4.0";
11
-    
11
+
12 12
     /** @var Lang */
13 13
     public static $lang;
14 14
     /** @var Conf  */

+ 2
- 2
lib/CLI.php View File

@@ -8,7 +8,7 @@ namespace JKingWeb\Arsse;
8 8
 
9 9
 class CLI {
10 10
     protected $args = [];
11
-    
11
+
12 12
     protected function usage(): string {
13 13
         $prog = basename($_SERVER['argv'][0]);
14 14
         return <<<USAGE_TEXT
@@ -21,7 +21,7 @@ Usage:
21 21
     $prog --help | -h
22 22
 
23 23
 The Arsse command-line interface currently allows you to start the refresh
24
-daemon, refresh a specific feed by numeric ID, add a user, or save default 
24
+daemon, refresh a specific feed by numeric ID, add a user, or save default
25 25
 configuration to a sample file.
26 26
 USAGE_TEXT;
27 27
     }

+ 1
- 1
lib/Conf.php View File

@@ -56,7 +56,7 @@ class Conf {
56 56
     public $serviceCurlUser         = null;
57 57
     /** @var string The password to use when performing feed updates using cURL */
58 58
     public $serviceCurlPassword     = null;
59
-    
59
+
60 60
     /** @var integer Number of seconds to wait for data when fetching feeds from foreign servers */
61 61
     public $fetchTimeout            = 10;
62 62
     /** @var integer Maximum size, in bytes, of data when fetching feeds from foreign servers */

+ 36
- 36
lib/Database.php View File

@@ -21,7 +21,7 @@ class Database {
21 21
     const LIST_CONSERVATIVE = 1; // base metadata plus anything that is not potentially large text
22 22
     const LIST_TYPICAL      = 2; // conservative, with the addition of content
23 23
     const LIST_FULL         = 3; // all possible fields
24
-    
24
+
25 25
     /** @var Db\Driver */
26 26
     public $db;
27 27
 
@@ -37,7 +37,7 @@ class Database {
37 37
     protected function caller(): string {
38 38
         return debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3)[2]['function'];
39 39
     }
40
-    
40
+
41 41
     public static function driverList(): array {
42 42
         $sep = \DIRECTORY_SEPARATOR;
43 43
         $path = __DIR__.$sep."Db".$sep;
@@ -102,7 +102,7 @@ class Database {
102 102
     public function metaGet(string $key) {
103 103
         return $this->db->prepare("SELECT value from arsse_meta where key = ?", "str")->run($key)->getValue();
104 104
     }
105
-    
105
+
106 106
     public function metaSet(string $key, $value, string $type = "str"): bool {
107 107
         $out = $this->db->prepare("UPDATE arsse_meta set value = ? where key = ?", $type, "str")->run($value, $key)->changes();
108 108
         if (!$out) {
@@ -444,7 +444,7 @@ class Database {
444 444
                 target as (select ? as user, ? as source, ? as dest, ? as rename),
445 445
                 folders as (SELECT id from arsse_folders join target on owner = user and coalesce(parent,0) = source union select arsse_folders.id as id from arsse_folders join folders on arsse_folders.parent=folders.id)
446 446
             ".
447
-            "SELECT 
447
+            "SELECT
448 448
                 ((select dest from target) is null or exists(select id from arsse_folders join target on owner = user and coalesce(id,0) = coalesce(dest,0))) as extant,
449 449
                 not exists(select id from folders where id = coalesce((select dest from target),0)) as valid,
450 450
                 not exists(select id from arsse_folders join target on coalesce(parent,0) = coalesce(dest,0) and name = coalesce((select rename from target),(select name from arsse_folders join target on id = source))) as available
@@ -524,16 +524,16 @@ class Database {
524 524
         $folder = $this->folderValidateId($user, $folder)['id'];
525 525
         // create a complex query
526 526
         $q = new Query(
527
-            "SELECT 
527
+            "SELECT
528 528
                 arsse_subscriptions.id as id,
529 529
                 feed,url,favicon,source,folder,pinned,err_count,err_msg,order_type,added,
530 530
                 arsse_feeds.updated as updated,
531 531
                 topmost.top as top_folder,
532 532
                 coalesce(arsse_subscriptions.title, arsse_feeds.title) as title,
533 533
                 (SELECT count(*) from arsse_articles where feed = arsse_subscriptions.feed) - (SELECT count(*) from arsse_marks where subscription = arsse_subscriptions.id and read = 1) as unread
534
-             from arsse_subscriptions 
535
-                join user on user = owner 
536
-                join arsse_feeds on feed = arsse_feeds.id 
534
+             from arsse_subscriptions
535
+                join user on user = owner
536
+                join arsse_feeds on feed = arsse_feeds.id
537 537
                 left join topmost on folder=f_id"
538 538
         );
539 539
         $q->setOrder("pinned desc, title collate nocase");
@@ -673,7 +673,7 @@ class Database {
673 673
         $feeds = $this->db->query("SELECT id from arsse_feeds where next_fetch <= CURRENT_TIMESTAMP")->getAll();
674 674
         return array_column($feeds, 'id');
675 675
     }
676
-    
676
+
677 677
     public function feedUpdate($feedID, bool $throwError = false): bool {
678 678
         // check to make sure the feed exists
679 679
         if (!ValueInfo::id($feedID)) {
@@ -874,13 +874,13 @@ class Database {
874 874
             $extraColumns .= ",";
875 875
         }
876 876
         $q = new Query(
877
-            "SELECT 
877
+            "SELECT
878 878
                 $extraColumns
879 879
                 arsse_articles.id as id,
880 880
                 arsse_articles.feed as feed,
881 881
                 arsse_articles.modified as modified_date,
882 882
                 max(
883
-                    arsse_articles.modified, 
883
+                    arsse_articles.modified,
884 884
                     coalesce((select modified from arsse_marks where article = arsse_articles.id and subscription in (select sub from subscribed_feeds)),''),
885 885
                     coalesce((select modified from arsse_label_members where article = arsse_articles.id and subscription in (select sub from subscribed_feeds)),'')
886 886
                 ) as marked_date,
@@ -1137,17 +1137,17 @@ class Database {
1137 1137
             ];
1138 1138
             // the two queries we want to execute to make the requested changes
1139 1139
             $queries = [
1140
-                "UPDATE arsse_marks 
1141
-                    set 
1140
+                "UPDATE arsse_marks
1141
+                    set
1142 1142
                         read = case when (select honour_read from target_articles where target_articles.id = article) = 1 then (select read from target_values) else read end,
1143 1143
                         starred = coalesce((select starred from target_values),starred),
1144 1144
                         note = coalesce((select note from target_values),note),
1145
-                        modified = CURRENT_TIMESTAMP  
1146
-                    WHERE 
1145
+                        modified = CURRENT_TIMESTAMP
1146
+                    WHERE
1147 1147
                         subscription in (select sub from subscribed_feeds)
1148 1148
                         and article in (select id from target_articles where to_insert = 0 and (honour_read = 1 or honour_star = 1 or (select note from target_values) is not null))",
1149 1149
                 "INSERT INTO arsse_marks(subscription,article,read,starred,note)
1150
-                    select 
1150
+                    select
1151 1151
                         (select id from arsse_subscriptions join user on user = owner where arsse_subscriptions.feed = target_articles.feed),
1152 1152
                         id,
1153 1153
                         coalesce((select read from target_values) * honour_read,0),
@@ -1238,18 +1238,18 @@ class Database {
1238 1238
     public function articleCleanup(): bool {
1239 1239
         $query = $this->db->prepare(
1240 1240
             "WITH target_feed(id,subs) as (".
1241
-                "SELECT 
1241
+                "SELECT
1242 1242
                     id, (select count(*) from arsse_subscriptions where feed = arsse_feeds.id) as subs
1243 1243
                 from arsse_feeds where id = ?".
1244 1244
             "), excepted_articles(id,edition) as (".
1245
-                "SELECT 
1246
-                    arsse_articles.id, (select max(id) from arsse_editions where article = arsse_articles.id) as edition 
1245
+                "SELECT
1246
+                    arsse_articles.id, (select max(id) from arsse_editions where article = arsse_articles.id) as edition
1247 1247
                 from arsse_articles
1248
-                    join target_feed on arsse_articles.feed = target_feed.id 
1248
+                    join target_feed on arsse_articles.feed = target_feed.id
1249 1249
                 order by edition desc limit ?".
1250 1250
             ") ".
1251
-            "DELETE from arsse_articles where 
1252
-                feed = (select max(id) from target_feed) 
1251
+            "DELETE from arsse_articles where
1252
+                feed = (select max(id) from target_feed)
1253 1253
                 and id not in (select id from excepted_articles)
1254 1254
                 and (select count(*) from arsse_marks where article = arsse_articles.id and starred = 1) = 0
1255 1255
                 and (
@@ -1282,13 +1282,13 @@ class Database {
1282 1282
             throw new Db\ExceptionInput("typeViolation", ["action" => $this->caller(), "field" => "article", 'type' => "int > 0"]); // @codeCoverageIgnore
1283 1283
         }
1284 1284
         $out = $this->db->prepare(
1285
-            "SELECT 
1286
-                arsse_articles.id as article, 
1285
+            "SELECT
1286
+                arsse_articles.id as article,
1287 1287
                 (select max(id) from arsse_editions where article = arsse_articles.id) as edition
1288 1288
             FROM arsse_articles
1289 1289
                 join arsse_feeds on arsse_feeds.id = arsse_articles.feed
1290 1290
                 join arsse_subscriptions on arsse_subscriptions.feed = arsse_feeds.id
1291
-            WHERE 
1291
+            WHERE
1292 1292
                 arsse_articles.id = ? and arsse_subscriptions.owner = ?",
1293 1293
             "int",
1294 1294
             "str"
@@ -1304,15 +1304,15 @@ class Database {
1304 1304
             throw new Db\ExceptionInput("typeViolation", ["action" => $this->caller(), "field" => "edition", 'type' => "int > 0"]); // @codeCoverageIgnore
1305 1305
         }
1306 1306
         $out = $this->db->prepare(
1307
-            "SELECT 
1308
-                arsse_editions.id as edition, 
1307
+            "SELECT
1308
+                arsse_editions.id as edition,
1309 1309
                 arsse_editions.article as article,
1310 1310
                 (arsse_editions.id = (select max(id) from arsse_editions where article = arsse_editions.article)) as current
1311 1311
             FROM arsse_editions
1312 1312
                 join arsse_articles on arsse_editions.article = arsse_articles.id
1313 1313
                 join arsse_feeds on arsse_feeds.id = arsse_articles.feed
1314 1314
                 join arsse_subscriptions on arsse_subscriptions.feed = arsse_feeds.id
1315
-            WHERE 
1315
+            WHERE
1316 1316
                 edition = ? and arsse_subscriptions.owner = ?",
1317 1317
             "int",
1318 1318
             "str"
@@ -1359,10 +1359,10 @@ class Database {
1359 1359
             throw new User\ExceptionAuthz("notAuthorized", ["action" => __FUNCTION__, "user" => $user]);
1360 1360
         }
1361 1361
         return $this->db->prepare(
1362
-            "SELECT 
1362
+            "SELECT
1363 1363
                 id,name,
1364 1364
                 (select count(*) from arsse_label_members where label = id and assigned = 1) as articles,
1365
-                (select count(*) from arsse_label_members 
1365
+                (select count(*) from arsse_label_members
1366 1366
                     join arsse_marks on arsse_label_members.article = arsse_marks.article and arsse_label_members.subscription = arsse_marks.subscription
1367 1367
                  where label = id and assigned = 1 and read = 1
1368 1368
                 ) as read
@@ -1395,10 +1395,10 @@ class Database {
1395 1395
         $field = $byName ? "name" : "id";
1396 1396
         $type = $byName ? "str" : "int";
1397 1397
         $out = $this->db->prepare(
1398
-            "SELECT 
1398
+            "SELECT
1399 1399
                 id,name,
1400 1400
                 (select count(*) from arsse_label_members where label = id and assigned = 1) as articles,
1401
-                (select count(*) from arsse_label_members 
1401
+                (select count(*) from arsse_label_members
1402 1402
                     join arsse_marks on arsse_label_members.article = arsse_marks.article and arsse_label_members.subscription = arsse_marks.subscription
1403 1403
                  where label = id and assigned = 1 and read = 1
1404 1404
                 ) as read
@@ -1484,11 +1484,11 @@ class Database {
1484 1484
             $q->setWhere("not exists(select article from arsse_label_members where label = ? and article = arsse_articles.id)", "int", $id);
1485 1485
             $q->pushCTE("target_articles");
1486 1486
             $q->setBody(
1487
-                "INSERT INTO 
1488
-                    arsse_label_members(label,article,subscription) 
1489
-                SELECT 
1487
+                "INSERT INTO
1488
+                    arsse_label_members(label,article,subscription)
1489
+                SELECT
1490 1490
                     ?,id,
1491
-                    (select id from arsse_subscriptions join user on user = owner where arsse_subscriptions.feed = target_articles.feed) 
1491
+                    (select id from arsse_subscriptions join user on user = owner where arsse_subscriptions.feed = target_articles.feed)
1492 1492
                 FROM target_articles",
1493 1493
                 "int",
1494 1494
                 $id

+ 1
- 1
lib/Db/AbstractDriver.php View File

@@ -76,7 +76,7 @@ abstract class AbstractDriver implements Driver {
76 76
     public function begin(bool $lock = false): Transaction {
77 77
         return new Transaction($this, $lock);
78 78
     }
79
-    
79
+
80 80
     public function savepointCreate(bool $lock = false): int {
81 81
         if ($lock && !$this->transDepth) {
82 82
             $this->lock();

+ 1
- 1
lib/Db/Driver.php View File

@@ -12,7 +12,7 @@ interface Driver {
12 12
     const TR_ROLLBACK = 2;
13 13
     const TR_PEND_COMMIT = -1;
14 14
     const TR_PEND_ROLLBACK = -2;
15
-    
15
+
16 16
     public static function create(): Driver;
17 17
     // returns a human-friendly name for the driver (for display in installer, for example)
18 18
     public static function driverName(): string;

+ 1
- 1
lib/Feed.php View File

@@ -44,7 +44,7 @@ class Feed {
44 44
         libxml_use_internal_errors(false);
45 45
         return $out;
46 46
     }
47
-    
47
+
48 48
     public function __construct(int $feedID = null, string $url, string $lastModified = '', string $etag = '', string $username = '', string $password = '', bool $scrape = false) {
49 49
         // fetch the feed
50 50
         $this->resource = self::download($url, $lastModified, $etag, $username, $password);

+ 18
- 18
lib/Misc/Context.php View File

@@ -58,79 +58,79 @@ class Context {
58 58
         }
59 59
         return array_values(array_filter($spec));
60 60
     }
61
-    
61
+
62 62
     public function reverse(bool $spec = null) {
63 63
         return $this->act(__FUNCTION__, func_num_args(), $spec);
64 64
     }
65
-    
65
+
66 66
     public function limit(int $spec = null) {
67 67
         return $this->act(__FUNCTION__, func_num_args(), $spec);
68 68
     }
69
-    
69
+
70 70
     public function offset(int $spec = null) {
71 71
         return $this->act(__FUNCTION__, func_num_args(), $spec);
72 72
     }
73
-    
73
+
74 74
     public function folder(int $spec = null) {
75 75
         return $this->act(__FUNCTION__, func_num_args(), $spec);
76 76
     }
77
-    
77
+
78 78
     public function folderShallow(int $spec = null) {
79 79
         return $this->act(__FUNCTION__, func_num_args(), $spec);
80 80
     }
81
-    
81
+
82 82
     public function subscription(int $spec = null) {
83 83
         return $this->act(__FUNCTION__, func_num_args(), $spec);
84 84
     }
85
-    
85
+
86 86
     public function latestArticle(int $spec = null) {
87 87
         return $this->act(__FUNCTION__, func_num_args(), $spec);
88 88
     }
89
-    
89
+
90 90
     public function oldestArticle(int $spec = null) {
91 91
         return $this->act(__FUNCTION__, func_num_args(), $spec);
92 92
     }
93
-    
93
+
94 94
     public function latestEdition(int $spec = null) {
95 95
         return $this->act(__FUNCTION__, func_num_args(), $spec);
96 96
     }
97
-    
97
+
98 98
     public function oldestEdition(int $spec = null) {
99 99
         return $this->act(__FUNCTION__, func_num_args(), $spec);
100 100
     }
101
-    
101
+
102 102
     public function unread(bool $spec = null) {
103 103
         return $this->act(__FUNCTION__, func_num_args(), $spec);
104 104
     }
105
-    
105
+
106 106
     public function starred(bool $spec = null) {
107 107
         return $this->act(__FUNCTION__, func_num_args(), $spec);
108 108
     }
109
-    
109
+
110 110
     public function modifiedSince($spec = null) {
111 111
         $spec = Date::normalize($spec);
112 112
         return $this->act(__FUNCTION__, func_num_args(), $spec);
113 113
     }
114
-    
114
+
115 115
     public function notModifiedSince($spec = null) {
116 116
         $spec = Date::normalize($spec);
117 117
         return $this->act(__FUNCTION__, func_num_args(), $spec);
118 118
     }
119
-    
119
+
120 120
     public function markedSince($spec = null) {
121 121
         $spec = Date::normalize($spec);
122 122
         return $this->act(__FUNCTION__, func_num_args(), $spec);
123 123
     }
124
-    
124
+
125 125
     public function notMarkedSince($spec = null) {
126 126
         $spec = Date::normalize($spec);
127 127
         return $this->act(__FUNCTION__, func_num_args(), $spec);
128 128
     }
129
-    
129
+
130 130
     public function edition(int $spec = null) {
131 131
         return $this->act(__FUNCTION__, func_num_args(), $spec);
132 132
     }
133
-    
133
+
134 134
     public function article(int $spec = null) {
135 135
         return $this->act(__FUNCTION__, func_num_args(), $spec);
136 136
     }

+ 1
- 1
lib/REST/AbstractHandler.php View File

@@ -24,7 +24,7 @@ abstract class AbstractHandler implements Handler {
24 24
         }
25 25
         return $out;
26 26
     }
27
-    
27
+
28 28
     protected function fieldMapTypes(array $data, array $map, string $dateFormat = "sql"): array {
29 29
         foreach ($map as $key => $type) {
30 30
             if (array_key_exists($key, $data)) {

+ 6
- 6
lib/REST/NextCloudNews/V1_2.php View File

@@ -74,7 +74,7 @@ class V1_2 extends \JKingWeb\Arsse\REST\AbstractHandler {
74 74
         '/status'                => ['GET' => "serverStatus"],
75 75
         '/user'                  => ['GET' => "userStatus"],
76 76
     ];
77
-    
77
+
78 78
     public function __construct() {
79 79
     }
80 80
 
@@ -152,7 +152,7 @@ class V1_2 extends \JKingWeb\Arsse\REST\AbstractHandler {
152 152
         $target->query = "";
153 153
         return (string) $target;
154 154
     }
155
-    
155
+
156 156
     protected function chooseCall(string $url, string $method): string {
157 157
         // // normalize the URL path: change any IDs to 1 for easier comparison
158 158
         $url = $this->normalizePathIds($url);
@@ -282,7 +282,7 @@ class V1_2 extends \JKingWeb\Arsse\REST\AbstractHandler {
282 282
             return new EmptyResponse(404);
283 283
         }
284 284
     }
285
-    
285
+
286 286
     // list folders
287 287
     protected function folderList(array $url, array $data): ResponseInterface {
288 288
         $folders = [];
@@ -362,7 +362,7 @@ class V1_2 extends \JKingWeb\Arsse\REST\AbstractHandler {
362 362
         }
363 363
         return new EmptyResponse(204);
364 364
     }
365
-    
365
+
366 366
     // return list of feeds which should be refreshed
367 367
     protected function feedListStale(array $url, array $data): ResponseInterface {
368 368
         // function requires admin rights per spec
@@ -378,7 +378,7 @@ class V1_2 extends \JKingWeb\Arsse\REST\AbstractHandler {
378 378
         }
379 379
         return new Response(['feeds' => $out]);
380 380
     }
381
-    
381
+
382 382
     // refresh a feed
383 383
     protected function feedUpdate(array $url, array $data): ResponseInterface {
384 384
         // function requires admin rights per spec
@@ -431,7 +431,7 @@ class V1_2 extends \JKingWeb\Arsse\REST\AbstractHandler {
431 431
         }
432 432
         return new Response($out);
433 433
     }
434
-    
434
+
435 435
     // return list of feeds for the logged-in user
436 436
     protected function subscriptionList(array $url, array $data): ResponseInterface {
437 437
         $subs = Arsse::$db->subscriptionList(Arsse::$user->id);

+ 1
- 1
lib/REST/Target.php View File

@@ -14,7 +14,7 @@ class Target {
14 14
     public $path = [];
15 15
     public $query = "";
16 16
     public $fragment = "";
17
-    
17
+
18 18
     public function __construct(string $target) {
19 19
         $target = $this->parseFragment($target);
20 20
         $target = $this->parseQuery($target);

+ 3
- 3
lib/REST/TinyTinyRSS/API.php View File

@@ -87,7 +87,7 @@ class API extends \JKingWeb\Arsse\REST\AbstractHandler {
87 87
         'status'  => 1,
88 88
         'content' => ['error' => "MALFORMED_INPUT"],
89 89
     ];
90
-    
90
+
91 91
     public function __construct() {
92 92
     }
93 93
 
@@ -174,7 +174,7 @@ class API extends \JKingWeb\Arsse\REST\AbstractHandler {
174 174
     public function opGetApiLevel(array $data): array {
175 175
         return ['level' => self::LEVEL];
176 176
     }
177
-    
177
+
178 178
     public function opGetVersion(array $data): array {
179 179
         return [
180 180
             'version'       => self::VERSION,
@@ -186,7 +186,7 @@ class API extends \JKingWeb\Arsse\REST\AbstractHandler {
186 186
         $user = $data['user'] ?? "";
187 187
         $pass = $data['password'] ?? "";
188 188
         if (!Arsse::$conf->userSessionEnforced && isset(Arsse::$user->id)) {
189
-            // if HTTP authentication was previously successful and sessions 
189
+            // if HTTP authentication was previously successful and sessions
190 190
             // are not enforced, create a session for the HTTP user regardless
191 191
             // of which user the API call mentions
192 192
             $id = Arsse::$db->sessionCreate(Arsse::$user->id);

+ 1
- 1
lib/REST/TinyTinyRSS/Exception.php View File

@@ -8,7 +8,7 @@ namespace JKingWeb\Arsse\REST\TinyTinyRSS;
8 8
 
9 9
 class Exception extends \Exception {
10 10
     protected $data = [];
11
-    
11
+
12 12
     public function __construct($msg = "UNSPECIFIED_ERROR", $data = [], $e = null) {
13 13
         $this->data = $data;
14 14
         parent::__construct($msg, 0, $e);

+ 2
- 2
lib/Service.php View File

@@ -9,7 +9,7 @@ namespace JKingWeb\Arsse;
9 9
 use JKingWeb\Arsse\Misc\Date;
10 10
 
11 11
 class Service {
12
-    
12
+
13 13
     /** @var Service\Driver */
14 14
     protected $drv;
15 15
     /** @var \DateInterval */
@@ -26,7 +26,7 @@ class Service {
26 26
         }
27 27
         return $classes;
28 28
     }
29
-    
29
+
30 30
     public static function interval(): \DateInterval {
31 31
         try {
32 32
             return new \DateInterval(Arsse::$conf->serviceFrequency);

+ 1
- 1
lib/Service/Curl/Driver.php View File

@@ -12,7 +12,7 @@ class Driver implements \JKingWeb\Arsse\Service\Driver {
12 12
     protected $options = [];
13 13
     protected $queue;
14 14
     protected $handles = [];
15
-    
15
+
16 16
     public static function driverName(): string {
17 17
         return Arsse::$lang->msg("Driver.Service.Curl.Name");
18 18
     }

+ 2
- 2
lib/Service/Forking/Driver.php View File

@@ -10,7 +10,7 @@ use JKingWeb\Arsse\Arsse;
10 10
 
11 11
 class Driver implements \JKingWeb\Arsse\Service\Driver {
12 12
     protected $queue = [];
13
-    
13
+
14 14
     public static function driverName(): string {
15 15
         return Arsse::$lang->msg("Driver.Service.Forking.Name");
16 16
     }
@@ -18,7 +18,7 @@ class Driver implements \JKingWeb\Arsse\Service\Driver {
18 18
     public static function requirementsMet(): bool {
19 19
         return function_exists("popen");
20 20
     }
21
-    
21
+
22 22
     public function __construct() {
23 23
     }
24 24
 

+ 2
- 2
lib/Service/Internal/Driver.php View File

@@ -10,7 +10,7 @@ use JKingWeb\Arsse\Arsse;
10 10
 
11 11
 class Driver implements \JKingWeb\Arsse\Service\Driver {
12 12
     protected $queue = [];
13
-    
13
+
14 14
     public static function driverName(): string {
15 15
         return Arsse::$lang->msg("Driver.Service.Internal.Name");
16 16
     }
@@ -19,7 +19,7 @@ class Driver implements \JKingWeb\Arsse\Service\Driver {
19 19
         // this driver has no requirements
20 20
         return true;
21 21
     }
22
-    
22
+
23 23
     public function __construct() {
24 24
     }
25 25
 

+ 2
- 2
locale/en.php View File

@@ -5,7 +5,7 @@
5 5
 
6 6
 return [
7 7
     'API.TTRSS.Category.Uncategorized'                                     => 'Uncategorized',
8
-    'API.TTRSS.Category.Special'                                           => 'Special', 
8
+    'API.TTRSS.Category.Special'                                           => 'Special',
9 9
     'API.TTRSS.Category.Labels'                                            => 'Labels',
10 10
     'API.TTRSS.Feed.All'                                                   => 'All articles',
11 11
     'API.TTRSS.Feed.Fresh'                                                 => 'Fresh articles',
@@ -181,4 +181,4 @@ return [
181 181
     'Exception.JKingWeb/Arsse/Feed/Exception.xmlEntity'                    => 'Refused to parse feed "{url}" because it contains an XXE attack',
182 182
     'Exception.JKingWeb/Arsse/Feed/Exception.subscriptionNotFound'         => 'Unable to find a feed at location "{url}"',
183 183
     'Exception.JKingWeb/Arsse/Feed/Exception.unsupportedFeedFormat'        => 'Feed "{url}" is of an unsupported format',
184
-];
184
+];

+ 2
- 2
sql/SQLite3/0.sql View File

@@ -105,7 +105,7 @@ create table arsse_marks(
105 105
     subscription integer not null references arsse_subscriptions(id) on delete cascade on update cascade,
106 106
     read boolean not null default 0,
107 107
     starred boolean not null default 0,
108
-    modified text not null default CURRENT_TIMESTAMP,    
108
+    modified text not null default CURRENT_TIMESTAMP,
109 109
     primary key(article,subscription)
110 110
 );
111 111
 
@@ -124,4 +124,4 @@ create table arsse_categories(
124 124
 
125 125
 -- set version marker
126 126
 pragma user_version = 1;
127
-insert into arsse_meta(key,value) values('schema_version','1');
127
+insert into arsse_meta(key,value) values('schema_version','1');

+ 2
- 2
tests/cases/Db/SQLite3/TestStatement.php View File

@@ -49,7 +49,7 @@ class TestStatement extends \JKingWeb\Arsse\Test\AbstractTest {
49 49
         $typeStr = "'".str_replace("'", "''", $type)."'";
50 50
         $nativeStatement = $this->c->prepare(
51 51
             "SELECT (
52
-                    (CASE WHEN substr($typeStr, 0, 7) <> 'strict ' then null else 1 end) is null 
52
+                    (CASE WHEN substr($typeStr, 0, 7) <> 'strict ' then null else 1 end) is null
53 53
                     and ? is null
54 54
             ) or (
55 55
                     $exp = ?
@@ -250,7 +250,7 @@ class TestStatement extends \JKingWeb\Arsse\Test\AbstractTest {
250 250
             [$dateImmutable, "strict boolean",  "1"],
251 251
         ];
252 252
     }
253
-    
253
+
254 254
     public function testConstructStatement() {
255 255
         $nativeStatement = $this->c->prepare("SELECT ? as value");
256 256
         $this->assertInstanceOf(Statement::class, new \JKingWeb\Arsse\Db\SQLite3\Statement($this->c, $nativeStatement));

+ 1
- 1
tests/cases/Db/SQLite3PDO/TestStatement.php View File

@@ -50,7 +50,7 @@ class TestStatement extends \JKingWeb\Arsse\Test\AbstractTest {
50 50
         $typeStr = "'".str_replace("'", "''", $type)."'";
51 51
         $nativeStatement = $this->c->prepare(
52 52
             "SELECT (
53
-                    (CASE WHEN substr($typeStr, 0, 7) <> 'strict ' then null else 1 end) is null 
53
+                    (CASE WHEN substr($typeStr, 0, 7) <> 'strict ' then null else 1 end) is null
54 54
                     and ? is null
55 55
             ) or (
56 56
                     $exp = ?

+ 4
- 4
tests/cases/Feed/TestFeed.php View File

@@ -172,7 +172,7 @@ class TestFeed extends \JKingWeb\Arsse\Test\AbstractTest {
172 172
         $this->assertException("malformedXml", "Feed");
173 173
         new Feed(null, $this->base."Parsing/Malformed");
174 174
     }
175
-    
175
+
176 176
     public function testDeduplicateFeedItems() {
177 177
         // duplicates with dates lead to the newest match being kept
178 178
         $t = strtotime("2002-05-19T15:21:36Z");
@@ -245,7 +245,7 @@ class TestFeed extends \JKingWeb\Arsse\Test\AbstractTest {
245 245
         $f = new Feed(null, $this->base."Caching/200None");
246 246
         $this->assertTime($t, $f->lastModified);
247 247
     }
248
-    
248
+
249 249
     public function testComputeNextFetchOnError() {
250 250
         for ($a = 0; $a < 100; $a++) {
251 251
             if ($a < 3) {
@@ -257,7 +257,7 @@ class TestFeed extends \JKingWeb\Arsse\Test\AbstractTest {
257 257
             }
258 258
         }
259 259
     }
260
-    
260
+
261 261
     public function testComputeNextFetchFrom304() {
262 262
         // if less than half an hour, check in 15 minutes
263 263
         $t = strtotime("now");
@@ -305,7 +305,7 @@ class TestFeed extends \JKingWeb\Arsse\Test\AbstractTest {
305 305
         $exp = strtotime("now + 3 hours");
306 306
         $this->assertTime($exp, $f->nextFetch);
307 307
     }
308
-    
308
+
309 309
     public function testComputeNextFetchFrom200() {
310 310
         // if less than half an hour, check in 15 minutes
311 311
         $f = new Feed(null, $this->base."NextFetch/30m");

+ 1
- 1
tests/cases/Misc/TestValueInfo.php View File

@@ -16,7 +16,7 @@ class TestValueInfo extends \JKingWeb\Arsse\Test\AbstractTest {
16 16
     public function setUp() {
17 17
         $this->clearData();
18 18
     }
19
-    
19
+
20 20
     public function testGetIntegerInfo() {
21 21
         $tests = [
22 22
             [null,          I::NULL],

+ 1
- 1
tests/cases/REST/NextCloudNews/TestV1_2.php View File

@@ -934,7 +934,7 @@ class TestV1_2 extends \JKingWeb\Arsse\Test\AbstractTest {
934 934
         $exp = new EmptyResponse(403);
935 935
         $this->assertMessage($exp, $this->req("GET", "/cleanup/before-update"));
936 936
     }
937
-    
937
+
938 938
     public function testCleanUpAfterUpdate() {
939 939
         Phake::when(Arsse::$db)->articleCleanup()->thenReturn(true);
940 940
         $exp = new EmptyResponse(204);

+ 2
- 2
tests/cases/REST/TestREST.php View File

@@ -60,7 +60,7 @@ class TestREST extends \JKingWeb\Arsse\Test\AbstractTest {
60 60
             [$fake, "/full/url-not",                       []],
61 61
         ];
62 62
     }
63
-    
63
+
64 64
     /** @dataProvider provideAuthenticableRequests */
65 65
     public function testAuthenticateRequests(array $serverParams, array $expAttr) {
66 66
         $r = new REST();
@@ -105,7 +105,7 @@ class TestREST extends \JKingWeb\Arsse\Test\AbstractTest {
105 105
         $act = $r->challenge($in);
106 106
         $this->assertMessage($exp, $act);
107 107
     }
108
-    
108
+
109 109
     /** @dataProvider provideUnnormalizedOrigins */
110 110
     public function testNormalizeOrigins(string $origin, string $exp, array $ports = null) {
111 111
         $r = new REST();

+ 17
- 17
tests/cases/REST/TinyTinyRSS/TestAPI.php View File

@@ -105,21 +105,21 @@ class TestAPI extends \JKingWeb\Arsse\Test\AbstractTest {
105 105
     protected $richContent = <<<LONG_STRING
106 106
 <section>
107 107
     <p>
108
-        <b>Pour</b> vous faire mieux 
109
-        connaitre d’ou\u{300} vient 
110
-        l’erreur de ceux qui 
111
-        bla\u{302}ment la 
112
-        volupte\u{301}, et qui louent 
113
-        en quelque sorte la douleur, 
114
-        je vais entrer dans une 
115
-        explication plus 
116
-        e\u{301}tendue, et vous faire 
117
-        voir tout ce qui a 
118
-        e\u{301}te\u{301} dit 
119
-        la\u{300}-dessus par 
120
-        l’inventeur de la 
121
-        ve\u{301}rite\u{301}, et, pour 
122
-        ainsi dire, par l’architecte 
108
+        <b>Pour</b> vous faire mieux
109
+        connaitre d’ou\u{300} vient
110
+        l’erreur de ceux qui
111
+        bla\u{302}ment la
112
+        volupte\u{301}, et qui louent
113
+        en quelque sorte la douleur,
114
+        je vais entrer dans une
115
+        explication plus
116
+        e\u{301}tendue, et vous faire
117
+        voir tout ce qui a
118
+        e\u{301}te\u{301} dit
119
+        la\u{300}-dessus par
120
+        l’inventeur de la
121
+        ve\u{301}rite\u{301}, et, pour
122
+        ainsi dire, par l’architecte
123 123
         de la vie heureuse.
124 124
     </p>
125 125
 </section>
@@ -157,7 +157,7 @@ LONG_STRING;
157 157
     protected function reqAuth($data, $user) {
158 158
         return $this->req($data, "POST", "", null, $user);
159 159
     }
160
-    
160
+
161 161
     protected function respGood($content = null, $seq = 0): Response {
162 162
         return new Response([
163 163
             'seq' => $seq,
@@ -1551,7 +1551,7 @@ LONG_STRING;
1551 1551
             ['op' => "updateArticle", 'sid' => "PriestsOfSyrinx", 'article_ids' => "42, 2112, -1", 'field' => 0, 'mode' => 1],
1552 1552
             ['op' => "updateArticle", 'sid' => "PriestsOfSyrinx", 'article_ids' => "42, 2112, -1", 'field' => 0, 'mode' => 2],
1553 1553
             ['op' => "updateArticle", 'sid' => "PriestsOfSyrinx", 'article_ids' => "42, 2112, -1", 'field' => 0, 'mode' => 3], // invalid mode
1554
-            
1554
+
1555 1555
             ['op' => "updateArticle", 'sid' => "PriestsOfSyrinx", 'article_ids' => "42, 2112, -1", 'field' => 1], // Published feed' no-op
1556 1556
             ['op' => "updateArticle", 'sid' => "PriestsOfSyrinx", 'article_ids' => "42, 2112, -1", 'field' => 1, 'mode' => 0],
1557 1557
             ['op' => "updateArticle", 'sid' => "PriestsOfSyrinx", 'article_ids' => "42, 2112, -1", 'field' => 1, 'mode' => 1],

+ 1
- 1
tests/cases/User/TestAuthorization.php View File

@@ -83,7 +83,7 @@ class TestAuthorization extends \JKingWeb\Arsse\Test\AbstractTest {
83 83
         $this->assertFalse(Arsse::$user->authorizationEnabled(true));
84 84
         $this->assertTrue(Arsse::$user->authorizationEnabled(true));
85 85
     }
86
-    
86
+
87 87
     public function testSelfActionLogic() {
88 88
         foreach (array_keys(self::USERS) as $user) {
89 89
             Arsse::$user->auth($user, "");

+ 1
- 1
tests/docroot/Feed/Fetching/Timeout.php View File

@@ -1,4 +1,4 @@
1
-<?php 
1
+<?php
2 2
 usleep(1.05 * 1000000);
3 3
 return [
4 4
     'code'    => 404,

+ 1
- 1
tests/docroot/Feed/Fetching/TooLarge.php View File

@@ -1,4 +1,4 @@
1
-<?php 
1
+<?php
2 2
 $item = '
3 3
     <item>
4 4
         <description>'.str_repeat("0", 1024).'</description>

+ 1
- 1
tests/docroot/Feed/NextFetch/NotModified.php View File

@@ -1,4 +1,4 @@
1
-<?php 
1
+<?php
2 2
 if (array_key_exists("t", $_GET)) {
3 3
     return [
4 4
         'code'    => 304,

+ 2
- 2
tests/docroot/Feed/Parsing/XXEAttack.php View File

@@ -1,8 +1,8 @@
1 1
 <?php return [
2 2
     'mime'    => "application/rss+xml",
3 3
     'content' => <<<MESSAGE_BODY
4
-<!DOCTYPE test [ 
5
-    <!ENTITY xxe SYSTEM "file:///etc/passwd"> 
4
+<!DOCTYPE test [
5
+    <!ENTITY xxe SYSTEM "file:///etc/passwd">
6 6
 ]>
7 7
 <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
8 8
 <channel>

+ 2
- 2
tests/lib/Database/SeriesCleanup.php View File

@@ -157,7 +157,7 @@ trait SeriesCleanup {
157 157
         }
158 158
         $this->compareExpectations($state);
159 159
     }
160
-    
160
+
161 161
     public function testCleanUpOldArticlesWithUnlimitedReadRetention() {
162 162
         Arsse::$conf->purgeArticlesRead = "";
163 163
         Arsse::$db->articleCleanup();
@@ -169,7 +169,7 @@ trait SeriesCleanup {
169 169
         }
170 170
         $this->compareExpectations($state);
171 171
     }
172
-    
172
+
173 173
     public function testCleanUpOldArticlesWithUnlimitedUnreadRetention() {
174 174
         Arsse::$conf->purgeArticlesUnread = "";
175 175
         Arsse::$db->articleCleanup();

+ 1
- 1
tests/lib/Database/SeriesFeed.php View File

@@ -30,7 +30,7 @@ trait SeriesFeed {
30 30
             'title_content_hash' => '43b970ac6ec5f8a9647b2c7e4eed8b1d7f62e154a95eed748b0294c1256764ba',
31 31
         ],
32 32
     ];
33
-    
33
+
34 34
     public function setUpSeries() {
35 35
         // set up the test data
36 36
         $past  = gmdate("Y-m-d H:i:s", strtotime("now - 1 minute"));

+ 10
- 10
tests/lib/Database/SeriesUser.php View File

@@ -58,7 +58,7 @@ trait SeriesUser {
58 58
         $this->assertException("notAuthorized", "User", "ExceptionAuthz");
59 59
         Arsse::$db->userPasswordGet("admin@example.net");
60 60
     }
61
-    
61
+
62 62
     public function testAddANewUser() {
63 63
         $this->assertSame("", Arsse::$db->userAdd("john.doe@example.org", ""));
64 64
         Phake::verify(Arsse::$user)->authorize("john.doe@example.org", "userAdd");
@@ -99,7 +99,7 @@ trait SeriesUser {
99 99
         $this->assertException("notAuthorized", "User", "ExceptionAuthz");
100 100
         Arsse::$db->userAdd("john.doe@example.org", "");
101 101
     }
102
-    
102
+
103 103
     public function testRemoveAUser() {
104 104
         $this->assertTrue(Arsse::$db->userRemove("admin@example.net"));
105 105
         Phake::verify(Arsse::$user)->authorize("admin@example.net", "userRemove");
@@ -112,7 +112,7 @@ trait SeriesUser {
112 112
         $this->assertException("doesNotExist", "User");
113 113
         Arsse::$db->userRemove("john.doe@example.org");
114 114
     }
115
-    
115
+
116 116
     public function testRemoveAUserWithoutAuthority() {
117 117
         Phake::when(Arsse::$user)->authorize->thenReturn(false);
118 118
         $this->assertException("notAuthorized", "User", "ExceptionAuthz");
@@ -130,13 +130,13 @@ trait SeriesUser {
130 130
         $this->assertSame($users, Arsse::$db->userList("example.com"));
131 131
         Phake::verify(Arsse::$user)->authorize("@example.com", "userList");
132 132
     }
133
-    
133
+
134 134
     public function testListAllUsersWithoutAuthority() {
135 135
         Phake::when(Arsse::$user)->authorize->thenReturn(false);
136 136
         $this->assertException("notAuthorized", "User", "ExceptionAuthz");
137 137
         Arsse::$db->userList();
138 138
     }
139
-    
139
+
140 140
     public function testListUsersOnADomainWithoutAuthority() {
141 141
         Phake::when(Arsse::$user)->authorize->thenReturn(false);
142 142
         $this->assertException("notAuthorized", "User", "ExceptionAuthz");
@@ -166,7 +166,7 @@ trait SeriesUser {
166 166
         $this->assertException("doesNotExist", "User");
167 167
         Arsse::$db->userPasswordSet("john.doe@example.org", "secret");
168 168
     }
169
-    
169
+
170 170
     public function testSetAPasswordWithoutAuthority() {
171 171
         Phake::when(Arsse::$user)->authorize->thenReturn(false);
172 172
         $this->assertException("notAuthorized", "User", "ExceptionAuthz");
@@ -188,7 +188,7 @@ trait SeriesUser {
188 188
         $this->assertException("doesNotExist", "User");
189 189
         Arsse::$db->userPropertiesGet("john.doe@example.org");
190 190
     }
191
-    
191
+
192 192
     public function testGetUserPropertiesWithoutAuthority() {
193 193
         Phake::when(Arsse::$user)->authorize->thenReturn(false);
194 194
         $this->assertException("notAuthorized", "User", "ExceptionAuthz");
@@ -223,7 +223,7 @@ trait SeriesUser {
223 223
         $this->assertException("doesNotExist", "User");
224 224
         Arsse::$db->userPropertiesSet("john.doe@example.org", $try);
225 225
     }
226
-    
226
+
227 227
     public function testSetUserPropertiesWithoutAuthority() {
228 228
         $try = ['name' => 'John Doe'];
229 229
         Phake::when(Arsse::$user)->authorize->thenReturn(false);
@@ -244,7 +244,7 @@ trait SeriesUser {
244 244
         $this->assertSame(UserDriver::RIGHTS_NONE, Arsse::$db->userRightsGet("john.doe@example.org"));
245 245
         Phake::verify(Arsse::$user)->authorize("john.doe@example.org", "userRightsGet");
246 246
     }
247
-    
247
+
248 248
     public function testGetUserRightsWithoutAuthority() {
249 249
         Phake::when(Arsse::$user)->authorize->thenReturn(false);
250 250
         $this->assertException("notAuthorized", "User", "ExceptionAuthz");
@@ -266,7 +266,7 @@ trait SeriesUser {
266 266
         $this->assertException("doesNotExist", "User");
267 267
         Arsse::$db->userRightsSet("john.doe@example.org", $rights);
268 268
     }
269
-    
269
+
270 270
     public function testSetUserRightsWithoutAuthority() {
271 271
         $rights = UserDriver::RIGHTS_GLOBAL_ADMIN;
272 272
         Phake::when(Arsse::$user)->authorize->thenReturn(false);

+ 4
- 4
www/tt-rss/images/README View File

@@ -1,14 +1,14 @@
1
-Silk icon set v1.3 
1
+Silk icon set v1.3
2 2
 Copyright 2006, Mark James
3 3
 http://www.famfamfam.com/lab/icons/silk/
4 4
 
5 5
 Used under license:
6 6
 http://creativecommons.org/licenses/by/2.5/
7 7
 
8
-A minimal subset of the Silk icon set used by Tiny Tiny RSS is included here 
9
-to provide consistent results with certain API functions. 
8
+A minimal subset of the Silk icon set used by Tiny Tiny RSS is included here
9
+to provide consistent results with certain API functions.
10 10
 
11
-Note that TT-RSS renames some of the icons, and we use the modified names, 
11
+Note that TT-RSS renames some of the icons, and we use the modified names,
12 12
 again for consistency. Below is a table listing the source file names:
13 13
 
14 14
 Modified        Original

Loading…
Cancel
Save