@@ -22,7 +22,9 @@ discard block |
||
22 | 22 | } |
23 | 23 | |
24 | 24 | public function hook_prefs_tab($args) { |
25 | - if ($args != "prefFeeds") return; |
|
25 | + if ($args != "prefFeeds") { |
|
26 | + return; |
|
27 | + } |
|
26 | 28 | |
27 | 29 | print "<div dojoType=\"dijit.layout.AccordionPane\" |
28 | 30 | title=\"<i class='material-icons'>extension</i> ".__('Reddit content settings (af_redditimgur)')."\">"; |
@@ -173,8 +175,7 @@ discard block |
||
173 | 175 | if ($child["data"]["url"] == $matches[0]) { |
174 | 176 | try { |
175 | 177 | $source_stream = $child["data"]["media"]["reddit_video"]["fallback_url"]; |
176 | - } |
|
177 | - catch (Exception $e) { |
|
178 | + } catch (Exception $e) { |
|
178 | 179 | } |
179 | 180 | break 2; |
180 | 181 | } |
@@ -230,8 +231,9 @@ discard block |
||
230 | 231 | |
231 | 232 | $source_stream = str_replace(".gifv", ".mp4", $entry->getAttribute("href")); |
232 | 233 | |
233 | - if (strpos($source_stream, "imgur.com") !== FALSE) |
|
234 | - $poster_url = str_replace(".mp4", "h.jpg", $source_stream); |
|
234 | + if (strpos($source_stream, "imgur.com") !== FALSE) { |
|
235 | + $poster_url = str_replace(".mp4", "h.jpg", $source_stream); |
|
236 | + } |
|
235 | 237 | |
236 | 238 | $this->handle_as_video($doc, $entry, $source_stream, $poster_url); |
237 | 239 | |
@@ -426,7 +428,9 @@ discard block |
||
426 | 428 | if ($row = $sth->fetch()) { |
427 | 429 | $num_found = $row['cid']; |
428 | 430 | |
429 | - if ($num_found > 0) $article["force_catchup"] = true; |
|
431 | + if ($num_found > 0) { |
|
432 | + $article["force_catchup"] = true; |
|
433 | + } |
|
430 | 434 | } |
431 | 435 | } |
432 | 436 | } |
@@ -458,7 +462,9 @@ discard block |
||
458 | 462 | $video->setAttribute("controls", "1"); |
459 | 463 | $video->setAttribute("loop", "1"); |
460 | 464 | |
461 | - if ($poster_url) $video->setAttribute("poster", $poster_url); |
|
465 | + if ($poster_url) { |
|
466 | + $video->setAttribute("poster", $poster_url); |
|
467 | + } |
|
462 | 468 | |
463 | 469 | $source = $doc->createElement('source'); |
464 | 470 | $source->setAttribute("src", $source_stream); |
@@ -14,7 +14,7 @@ |
||
14 | 14 | } |
15 | 15 | |
16 | 16 | public function get_js() { |
17 | - return file_get_contents(__DIR__ . "/init.js"); |
|
17 | + return file_get_contents(__DIR__."/init.js"); |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | public function api_version() { |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | } |
19 | 19 | |
20 | 20 | public function get_js() { |
21 | - return file_get_contents(dirname(__FILE__) . "/mail.js"); |
|
21 | + return file_get_contents(dirname(__FILE__)."/mail.js"); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | public function save() { |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | print "<div dojoType=\"dijit.layout.AccordionPane\" |
36 | 36 | title=\"<i class='material-icons'>mail</i> ".__('Mail plugin')."\">"; |
37 | 37 | |
38 | - print "<p>" . __("You can set predefined email addressed here (comma-separated list):") . "</p>"; |
|
38 | + print "<p>".__("You can set predefined email addressed here (comma-separated list):")."</p>"; |
|
39 | 39 | |
40 | 40 | print "<form dojoType=\"dijit.form.Form\">"; |
41 | 41 | |
@@ -115,17 +115,17 @@ discard block |
||
115 | 115 | $sth->execute(array_merge($ids, [$_SESSION['uid']])); |
116 | 116 | |
117 | 117 | if (count($ids) > 1) { |
118 | - $subject = __("[Forwarded]") . " " . __("Multiple articles"); |
|
118 | + $subject = __("[Forwarded]")." ".__("Multiple articles"); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | while ($line = $sth->fetch()) { |
122 | 122 | |
123 | 123 | if (!$subject) |
124 | - $subject = __("[Forwarded]") . " " . htmlspecialchars($line["title"]); |
|
124 | + $subject = __("[Forwarded]")." ".htmlspecialchars($line["title"]); |
|
125 | 125 | |
126 | 126 | $tpl->setVariable('ARTICLE_TITLE', strip_tags($line["title"])); |
127 | 127 | $tnote = strip_tags($line["note"]); |
128 | - if( $tnote != ''){ |
|
128 | + if ($tnote != '') { |
|
129 | 129 | $tpl->setVariable('ARTICLE_NOTE', $tnote, true); |
130 | 130 | $tpl->addBlock('note'); |
131 | 131 | } |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | "message" => $message]); |
211 | 211 | |
212 | 212 | if (!$rc) { |
213 | - $reply['error'] = $mailer->error(); |
|
213 | + $reply['error'] = $mailer->error(); |
|
214 | 214 | } else { |
215 | 215 | //save_email_address($destination); |
216 | 216 | $reply['message'] = "UPDATE_COUNTERS"; |
@@ -30,7 +30,9 @@ discard block |
||
30 | 30 | } |
31 | 31 | |
32 | 32 | public function hook_prefs_tab($args) { |
33 | - if ($args != "prefPrefs") return; |
|
33 | + if ($args != "prefPrefs") { |
|
34 | + return; |
|
35 | + } |
|
34 | 36 | |
35 | 37 | print "<div dojoType=\"dijit.layout.AccordionPane\" |
36 | 38 | title=\"<i class='material-icons'>mail</i> ".__('Mail plugin')."\">"; |
@@ -94,7 +96,9 @@ discard block |
||
94 | 96 | $user_name = htmlspecialchars($row['full_name']); |
95 | 97 | } |
96 | 98 | |
97 | - if (!$user_name) $user_name = $_SESSION['name']; |
|
99 | + if (!$user_name) { |
|
100 | + $user_name = $_SESSION['name']; |
|
101 | + } |
|
98 | 102 | |
99 | 103 | print_hidden("from_email", "$user_email"); |
100 | 104 | print_hidden("from_name", "$user_name"); |
@@ -120,8 +124,9 @@ discard block |
||
120 | 124 | |
121 | 125 | while ($line = $sth->fetch()) { |
122 | 126 | |
123 | - if (!$subject) |
|
124 | - $subject = __("[Forwarded]") . " " . htmlspecialchars($line["title"]); |
|
127 | + if (!$subject) { |
|
128 | + $subject = __("[Forwarded]") . " " . htmlspecialchars($line["title"]); |
|
129 | + } |
|
125 | 130 | |
126 | 131 | $tpl->setVariable('ARTICLE_TITLE', strip_tags($line["title"])); |
127 | 132 | $tnote = strip_tags($line["note"]); |
@@ -7,7 +7,7 @@ |
||
7 | 7 | |
8 | 8 | public function process(&$article) { |
9 | 9 | if (strpos($article["link"], "toothpastefordinner.com") !== FALSE || |
10 | - strpos($article["link"], "marriedtothesea.com") !== FALSE) { |
|
10 | + strpos($article["link"], "marriedtothesea.com") !== FALSE) { |
|
11 | 11 | $res = fetch_file_contents($article["link"], false, false, false, |
12 | 12 | false, false, 0, |
13 | 13 | "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)"); |
@@ -19,9 +19,9 @@ discard block |
||
19 | 19 | $host->add_hook($host::HOOK_ARTICLE_FILTER, $this); |
20 | 20 | $host->add_hook($host::HOOK_PREFS_TAB, $this); |
21 | 21 | |
22 | - require_once __DIR__ . "/filter_base.php"; |
|
22 | + require_once __DIR__."/filter_base.php"; |
|
23 | 23 | |
24 | - $filters = array_merge(glob(__DIR__ . "/filters.local/*.php"), glob(__DIR__ . "/filters/*.php")); |
|
24 | + $filters = array_merge(glob(__DIR__."/filters.local/*.php"), glob(__DIR__."/filters/*.php")); |
|
25 | 25 | $names = []; |
26 | 26 | |
27 | 27 | foreach ($filters as $file) { |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | print "<div dojoType=\"dijit.layout.AccordionPane\" |
51 | 51 | title=\"<i class='material-icons'>photo</i> ".__('Feeds supported by af_comics')."\">"; |
52 | 52 | |
53 | - print "<p>" . __("The following comics are currently supported:") . "</p>"; |
|
53 | + print "<p>".__("The following comics are currently supported:")."</p>"; |
|
54 | 54 | |
55 | 55 | $comics = array("GoComics"); |
56 | 56 | |
@@ -93,9 +93,9 @@ discard block |
||
93 | 93 | return $feed_data; |
94 | 94 | |
95 | 95 | if (preg_match('#^https?://(?:feeds\.feedburner\.com/uclick|www\.gocomics\.com)/([-a-z0-9]+)$#i', $fetch_url, $comic)) { |
96 | - $site_url = 'https://www.gocomics.com/' . $comic[1]; |
|
96 | + $site_url = 'https://www.gocomics.com/'.$comic[1]; |
|
97 | 97 | |
98 | - $article_link = $site_url . date('/Y/m/d'); |
|
98 | + $article_link = $site_url.date('/Y/m/d'); |
|
99 | 99 | |
100 | 100 | $body = fetch_file_contents(array('url' => $article_link, 'type' => 'text/html', 'followlocation' => false)); |
101 | 101 | |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | $title = date('l, F d, Y'); |
132 | 132 | } |
133 | 133 | |
134 | - foreach (['srcset', 'sizes', 'data-srcset', 'width'] as $attr ) { |
|
134 | + foreach (['srcset', 'sizes', 'data-srcset', 'width'] as $attr) { |
|
135 | 135 | $node->removeAttribute($attr); |
136 | 136 | } |
137 | 137 |
@@ -45,7 +45,9 @@ discard block |
||
45 | 45 | } |
46 | 46 | |
47 | 47 | public function hook_prefs_tab($args) { |
48 | - if ($args != "prefFeeds") return; |
|
48 | + if ($args != "prefFeeds") { |
|
49 | + return; |
|
50 | + } |
|
49 | 51 | |
50 | 52 | print "<div dojoType=\"dijit.layout.AccordionPane\" |
51 | 53 | title=\"<i class='material-icons'>photo</i> ".__('Feeds supported by af_comics')."\">"; |
@@ -77,8 +79,9 @@ discard block |
||
77 | 79 | |
78 | 80 | public function hook_article_filter($article) { |
79 | 81 | foreach ($this->filters as $f) { |
80 | - if ($f->process($article)) |
|
81 | - break; |
|
82 | + if ($f->process($article)) { |
|
83 | + break; |
|
84 | + } |
|
82 | 85 | } |
83 | 86 | |
84 | 87 | return $article; |
@@ -89,8 +92,9 @@ discard block |
||
89 | 92 | * @SuppressWarnings(PHPMD.UnusedFormalParameter) |
90 | 93 | */ |
91 | 94 | public function hook_fetch_feed($feed_data, $fetch_url, $owner_uid, $feed, $last_article_timestamp, $auth_login, $auth_pass) { |
92 | - if ($auth_login || $auth_pass) |
|
93 | - return $feed_data; |
|
95 | + if ($auth_login || $auth_pass) { |
|
96 | + return $feed_data; |
|
97 | + } |
|
94 | 98 | |
95 | 99 | if (preg_match('#^https?://(?:feeds\.feedburner\.com/uclick|www\.gocomics\.com)/([-a-z0-9]+)$#i', $fetch_url, $comic)) { |
96 | 100 | $site_url = 'https://www.gocomics.com/' . $comic[1]; |
@@ -153,29 +157,35 @@ discard block |
||
153 | 157 | |
154 | 158 | $tpl->addBlock('feed'); |
155 | 159 | |
156 | - if ($tpl->generateOutputToString($tmp_data)) |
|
157 | - $feed_data = $tmp_data; |
|
160 | + if ($tpl->generateOutputToString($tmp_data)) { |
|
161 | + $feed_data = $tmp_data; |
|
162 | + } |
|
158 | 163 | } |
159 | 164 | |
160 | 165 | return $feed_data; |
161 | 166 | } |
162 | 167 | |
163 | 168 | public function hook_subscribe_feed($contents, $url, $auth_login, $auth_pass) { |
164 | - if ($auth_login || $auth_pass) |
|
165 | - return $contents; |
|
169 | + if ($auth_login || $auth_pass) { |
|
170 | + return $contents; |
|
171 | + } |
|
166 | 172 | |
167 | - if (preg_match('#^https?://www\.gocomics\.com/([-a-z0-9]+)$#i', $url)) |
|
168 | - return '<?xml version="1.0" encoding="utf-8"?>'; // Get is_html() to return false. |
|
173 | + if (preg_match('#^https?://www\.gocomics\.com/([-a-z0-9]+)$#i', $url)) { |
|
174 | + return '<?xml version="1.0" encoding="utf-8"?>'; |
|
175 | + } |
|
176 | + // Get is_html() to return false. |
|
169 | 177 | |
170 | 178 | return $contents; |
171 | 179 | } |
172 | 180 | |
173 | 181 | public function hook_feed_basic_info($basic_info, $fetch_url, $owner_uid, $feed, $auth_login, $auth_pass) { |
174 | - if ($auth_login || $auth_pass) |
|
175 | - return $basic_info; |
|
182 | + if ($auth_login || $auth_pass) { |
|
183 | + return $basic_info; |
|
184 | + } |
|
176 | 185 | |
177 | - if (preg_match('#^https?://www\.gocomics\.com/([-a-z0-9]+)$#i', $fetch_url, $matches)) |
|
178 | - $basic_info = array('title' => ucfirst($matches[1]), 'site_url' => $matches[0]); |
|
186 | + if (preg_match('#^https?://www\.gocomics\.com/([-a-z0-9]+)$#i', $fetch_url, $matches)) { |
|
187 | + $basic_info = array('title' => ucfirst($matches[1]), 'site_url' => $matches[0]); |
|
188 | + } |
|
179 | 189 | |
180 | 190 | return $basic_info; |
181 | 191 | } |
@@ -200,13 +200,17 @@ |
||
200 | 200 | } |
201 | 201 | } |
202 | 202 | |
203 | - if ($need_saving) $article["content"] = $doc->saveHTML(); |
|
203 | + if ($need_saving) { |
|
204 | + $article["content"] = $doc->saveHTML(); |
|
205 | + } |
|
204 | 206 | |
205 | 207 | return $article; |
206 | 208 | } |
207 | 209 | |
208 | 210 | public function hook_prefs_tab($args) { |
209 | - if ($args != "prefFeeds") return; |
|
211 | + if ($args != "prefFeeds") { |
|
212 | + return; |
|
213 | + } |
|
210 | 214 | |
211 | 215 | print "<div dojoType=\"dijit.layout.AccordionPane\" |
212 | 216 | title=\"<i class='material-icons'>extension</i> ".__('Image proxy settings (af_proxy_http)')."\">"; |
@@ -14,11 +14,11 @@ |
||
14 | 14 | } |
15 | 15 | |
16 | 16 | public function get_css() { |
17 | - return file_get_contents(__DIR__ . "/init.css"); |
|
17 | + return file_get_contents(__DIR__."/init.css"); |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | public function get_js() { |
21 | - return file_get_contents(__DIR__ . "/init.js"); |
|
21 | + return file_get_contents(__DIR__."/init.js"); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | public function api_version() { |
@@ -13,7 +13,7 @@ |
||
13 | 13 | } |
14 | 14 | |
15 | 15 | public function get_js() { |
16 | - return file_get_contents(__DIR__ . "/init.js"); |
|
16 | + return file_get_contents(__DIR__."/init.js"); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | public function api_version() { |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | user_error("Your PHP has a separate systemwide Sphinx client installed which conflicts with the client library used by tt-rss. Either remove the system library or disable Sphinx support."); |
18 | 18 | } |
19 | 19 | |
20 | - require_once __DIR__ . "/sphinxapi.php"; |
|
20 | + require_once __DIR__."/sphinxapi.php"; |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | public function hook_search($search) { |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | $sphinxpair = explode(":", SPHINX_SERVER, 2); |
30 | 30 | |
31 | - $sphinxClient->SetServer($sphinxpair[0], (int)$sphinxpair[1]); |
|
31 | + $sphinxClient->SetServer($sphinxpair[0], (int) $sphinxpair[1]); |
|
32 | 32 | $sphinxClient->SetConnectTimeout(1); |
33 | 33 | |
34 | 34 | $sphinxClient->SetFieldWeights(array('title' => 70, 'content' => 30, |
@@ -53,10 +53,11 @@ |
||
53 | 53 | |
54 | 54 | $ids = join(",", $ids); |
55 | 55 | |
56 | - if ($ids) |
|
57 | - return array("ref_id IN ($ids)", array()); |
|
58 | - else |
|
59 | - return array("ref_id = -1", array()); |
|
56 | + if ($ids) { |
|
57 | + return array("ref_id IN ($ids)", array()); |
|
58 | + } else { |
|
59 | + return array("ref_id = -1", array()); |
|
60 | + } |
|
60 | 61 | } |
61 | 62 | |
62 | 63 | public function api_version() { |