@@ -17,15 +17,15 @@ discard block |
||
17 | 17 | } |
18 | 18 | |
19 | 19 | public function get_js() { |
20 | - return file_get_contents(dirname(__FILE__) . "/share.js"); |
|
20 | + return file_get_contents(dirname(__FILE__)."/share.js"); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | public function get_css() { |
24 | - return file_get_contents(dirname(__FILE__) . "/share.css"); |
|
24 | + return file_get_contents(dirname(__FILE__)."/share.css"); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | public function get_prefs_js() { |
28 | - return file_get_contents(dirname(__FILE__) . "/share_prefs.js"); |
|
28 | + return file_get_contents(dirname(__FILE__)."/share_prefs.js"); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | public function hook_prefs_tab_section($id) { |
43 | 43 | if ($id == "prefFeedsPublishedGenerated") { |
44 | 44 | |
45 | - print "<h3>" . __("You can disable all articles shared by unique URLs here.") . "</h3>"; |
|
45 | + print "<h3>".__("You can disable all articles shared by unique URLs here.")."</h3>"; |
|
46 | 46 | |
47 | 47 | print "<button class='alt-danger' dojoType='dijit.form.Button' onclick=\"return Plugins.Share.clearKeys()\">". |
48 | 48 | __('Unshare all articles')."</button> "; |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | $sth->execute([$uuid, $param, $_SESSION['uid']]); |
101 | 101 | } |
102 | 102 | |
103 | - print "<header>" . __("You can share this article by the following unique URL:") . "</header>"; |
|
103 | + print "<header>".__("You can share this article by the following unique URL:")."</header>"; |
|
104 | 104 | |
105 | 105 | $url_path = get_self_url_prefix(); |
106 | 106 | $url_path .= "/public.php?op=share&key=$uuid"; |
@@ -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() { |
@@ -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"]); |
@@ -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 | } |
@@ -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() { |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | } |
42 | 42 | |
43 | 43 | public function get_js() { |
44 | - return file_get_contents(__DIR__ . "/init.js"); |
|
44 | + return file_get_contents(__DIR__."/init.js"); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | public function showrelated() { |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | |
99 | 99 | print "</div>"; |
100 | 100 | |
101 | - print "<div style='text-align : right' class='text-muted'>" . smart_date_time(strtotime($line["updated"])) . "</div>"; |
|
101 | + print "<div style='text-align : right' class='text-muted'>".smart_date_time(strtotime($line["updated"]))."</div>"; |
|
102 | 102 | |
103 | 103 | print "</li>"; |
104 | 104 | } |
@@ -163,24 +163,24 @@ discard block |
||
163 | 163 | print_hidden("method", "save"); |
164 | 164 | print_hidden("plugin", "af_psql_trgm"); |
165 | 165 | |
166 | - print "<h2>" . __("Global settings") . "</h2>"; |
|
166 | + print "<h2>".__("Global settings")."</h2>"; |
|
167 | 167 | |
168 | 168 | print_notice("Enable for specific feeds in the feed editor."); |
169 | 169 | |
170 | 170 | print "<fieldset>"; |
171 | 171 | |
172 | - print "<label>" . __("Minimum similarity:") . "</label> "; |
|
172 | + print "<label>".__("Minimum similarity:")."</label> "; |
|
173 | 173 | print "<input dojoType=\"dijit.form.NumberSpinner\" |
174 | 174 | placeholder=\"0.75\" id='psql_trgm_similarity' |
175 | 175 | required=\"1\" name=\"similarity\" value=\"$similarity\">"; |
176 | 176 | |
177 | - print "<div dojoType='dijit.Tooltip' connectId='psql_trgm_similarity' position='below'>" . |
|
178 | - __("PostgreSQL trigram extension returns string similarity as a floating point number (0-1). Setting it too low might produce false positives, zero disables checking.") . |
|
177 | + print "<div dojoType='dijit.Tooltip' connectId='psql_trgm_similarity' position='below'>". |
|
178 | + __("PostgreSQL trigram extension returns string similarity as a floating point number (0-1). Setting it too low might produce false positives, zero disables checking."). |
|
179 | 179 | "</div>"; |
180 | 180 | |
181 | 181 | print "</fieldset><fieldset>"; |
182 | 182 | |
183 | - print "<label>" . __("Minimum title length:") . "</label> "; |
|
183 | + print "<label>".__("Minimum title length:")."</label> "; |
|
184 | 184 | print "<input dojoType=\"dijit.form.NumberSpinner\" |
185 | 185 | placeholder=\"32\" |
186 | 186 | required=\"1\" name=\"min_title_length\" value=\"$min_title_length\">"; |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | |
190 | 190 | print "<label class='checkbox'>"; |
191 | 191 | print_checkbox("enable_globally", $enable_globally); |
192 | - print " " . __("Enable for all feeds:"); |
|
192 | + print " ".__("Enable for all feeds:"); |
|
193 | 193 | print "</label>"; |
194 | 194 | |
195 | 195 | print "</fieldset>"; |
@@ -204,14 +204,14 @@ discard block |
||
204 | 204 | $this->host->set($this, "enabled_feeds", $enabled_feeds); |
205 | 205 | |
206 | 206 | if (count($enabled_feeds) > 0) { |
207 | - print "<h3>" . __("Currently enabled for (click to edit):") . "</h3>"; |
|
207 | + print "<h3>".__("Currently enabled for (click to edit):")."</h3>"; |
|
208 | 208 | |
209 | 209 | print "<ul class=\"panel panel-scrollable list list-unstyled\">"; |
210 | 210 | foreach ($enabled_feeds as $f) { |
211 | - print "<li>" . |
|
211 | + print "<li>". |
|
212 | 212 | "<i class='material-icons'>rss_feed</i> <a href='#' |
213 | - onclick='CommonDialogs.editFeed($f)'>" . |
|
214 | - Feeds::getFeedTitle($f) . "</a></li>"; |
|
213 | + onclick='CommonDialogs.editFeed($f)'>". |
|
214 | + Feeds::getFeedTitle($f)."</a></li>"; |
|
215 | 215 | } |
216 | 216 | print "</ul>"; |
217 | 217 | } |
@@ -15,10 +15,16 @@ discard block |
||
15 | 15 | $min_title_length = (int) $_POST["min_title_length"]; |
16 | 16 | $enable_globally = checkbox_to_sql_bool($_POST["enable_globally"]); |
17 | 17 | |
18 | - if ($similarity < 0) $similarity = 0; |
|
19 | - if ($similarity > 1) $similarity = 1; |
|
18 | + if ($similarity < 0) { |
|
19 | + $similarity = 0; |
|
20 | + } |
|
21 | + if ($similarity > 1) { |
|
22 | + $similarity = 1; |
|
23 | + } |
|
20 | 24 | |
21 | - if ($min_title_length < 0) $min_title_length = 0; |
|
25 | + if ($min_title_length < 0) { |
|
26 | + $min_title_length = 0; |
|
27 | + } |
|
22 | 28 | |
23 | 29 | $similarity = sprintf("%.2f", $similarity); |
24 | 30 | |
@@ -121,7 +127,9 @@ discard block |
||
121 | 127 | } |
122 | 128 | |
123 | 129 | public function hook_prefs_tab($args) { |
124 | - if ($args != "prefFeeds") return; |
|
130 | + if ($args != "prefFeeds") { |
|
131 | + return; |
|
132 | + } |
|
125 | 133 | |
126 | 134 | print "<div dojoType=\"dijit.layout.AccordionPane\" |
127 | 135 | title=\"<i class='material-icons'>extension</i> ".__('Mark similar articles as read')."\">"; |
@@ -140,8 +148,12 @@ discard block |
||
140 | 148 | $min_title_length = $this->host->get($this, "min_title_length"); |
141 | 149 | $enable_globally = $this->host->get($this, "enable_globally"); |
142 | 150 | |
143 | - if (!$similarity) $similarity = '0.75'; |
|
144 | - if (!$min_title_length) $min_title_length = '32'; |
|
151 | + if (!$similarity) { |
|
152 | + $similarity = '0.75'; |
|
153 | + } |
|
154 | + if (!$min_title_length) { |
|
155 | + $min_title_length = '32'; |
|
156 | + } |
|
145 | 157 | |
146 | 158 | print "<form dojoType=\"dijit.form.Form\">"; |
147 | 159 | |
@@ -198,7 +210,9 @@ discard block |
||
198 | 210 | print "</form>"; |
199 | 211 | |
200 | 212 | $enabled_feeds = $this->host->get($this, "enabled_feeds"); |
201 | - if (!array($enabled_feeds)) $enabled_feeds = array(); |
|
213 | + if (!array($enabled_feeds)) { |
|
214 | + $enabled_feeds = array(); |
|
215 | + } |
|
202 | 216 | |
203 | 217 | $enabled_feeds = $this->filter_unknown_feeds($enabled_feeds); |
204 | 218 | $this->host->set($this, "enabled_feeds", $enabled_feeds); |
@@ -225,7 +239,9 @@ discard block |
||
225 | 239 | print "<section>"; |
226 | 240 | |
227 | 241 | $enabled_feeds = $this->host->get($this, "enabled_feeds"); |
228 | - if (!array($enabled_feeds)) $enabled_feeds = array(); |
|
242 | + if (!array($enabled_feeds)) { |
|
243 | + $enabled_feeds = array(); |
|
244 | + } |
|
229 | 245 | |
230 | 246 | $key = array_search($feed_id, $enabled_feeds); |
231 | 247 | $checked = $key !== FALSE ? "checked" : ""; |
@@ -242,7 +258,9 @@ discard block |
||
242 | 258 | |
243 | 259 | public function hook_prefs_save_feed($feed_id) { |
244 | 260 | $enabled_feeds = $this->host->get($this, "enabled_feeds"); |
245 | - if (!is_array($enabled_feeds)) $enabled_feeds = array(); |
|
261 | + if (!is_array($enabled_feeds)) { |
|
262 | + $enabled_feeds = array(); |
|
263 | + } |
|
246 | 264 | |
247 | 265 | $enable = checkbox_to_sql_bool($_POST["trgm_similarity_enabled"]); |
248 | 266 | $key = array_search($feed_id, $enabled_feeds); |
@@ -262,24 +280,34 @@ discard block |
||
262 | 280 | |
263 | 281 | public function hook_article_filter($article) { |
264 | 282 | |
265 | - if (DB_TYPE != "pgsql") return $article; |
|
283 | + if (DB_TYPE != "pgsql") { |
|
284 | + return $article; |
|
285 | + } |
|
266 | 286 | |
267 | 287 | $res = $this->pdo->query("select 'similarity'::regproc"); |
268 | - if (!$res->fetch()) return $article; |
|
288 | + if (!$res->fetch()) { |
|
289 | + return $article; |
|
290 | + } |
|
269 | 291 | |
270 | 292 | $enable_globally = $this->host->get($this, "enable_globally"); |
271 | 293 | |
272 | 294 | if (!$enable_globally) { |
273 | 295 | $enabled_feeds = $this->host->get($this, "enabled_feeds"); |
274 | 296 | $key = array_search($article["feed"]["id"], $enabled_feeds); |
275 | - if ($key === FALSE) return $article; |
|
297 | + if ($key === FALSE) { |
|
298 | + return $article; |
|
299 | + } |
|
276 | 300 | } |
277 | 301 | |
278 | 302 | $similarity = (float) $this->host->get($this, "similarity"); |
279 | - if ($similarity < 0.01) return $article; |
|
303 | + if ($similarity < 0.01) { |
|
304 | + return $article; |
|
305 | + } |
|
280 | 306 | |
281 | 307 | $min_title_length = (int) $this->host->get($this, "min_title_length"); |
282 | - if (mb_strlen($article["title"]) < $min_title_length) return $article; |
|
308 | + if (mb_strlen($article["title"]) < $min_title_length) { |
|
309 | + return $article; |
|
310 | + } |
|
283 | 311 | |
284 | 312 | $owner_uid = $article["owner_uid"]; |
285 | 313 | $entry_guid = $article["guid_hashed"]; |