Passed
Push — master ( 5a5c41...fade3b )
by Cody
04:50 queued 10s
created
plugins/af_readability/init.php 1 patch
Braces   +21 added lines, -8 removed lines patch added patch discarded remove patch
@@ -47,7 +47,9 @@  discard block
 block discarded – undo
47 47
 	}
48 48
 
49 49
 	public function hook_prefs_tab($args) {
50
-		if ($args != "prefFeeds") return;
50
+		if ($args != "prefFeeds") {
51
+			return;
52
+		}
51 53
 
52 54
 		print "<div dojoType='dijit.layout.AccordionPane'
53 55
 			title=\"<i class='material-icons'>extension</i> ".__('Readability settings (af_readability)')."\">";
@@ -93,7 +95,9 @@  discard block
 block discarded – undo
93 95
 			print "</form>";
94 96
 
95 97
 			$enabled_feeds = $this->host->get($this, "enabled_feeds");
96
-			if (!is_array($enabled_feeds)) $enabled_feeds = array();
98
+			if (!is_array($enabled_feeds)) {
99
+				$enabled_feeds = array();
100
+			}
97 101
 
98 102
 			$enabled_feeds = $this->filter_unknown_feeds($enabled_feeds);
99 103
 			$this->host->set($this, "enabled_feeds", $enabled_feeds);
@@ -120,7 +124,9 @@  discard block
 block discarded – undo
120 124
 		print "<section>";
121 125
 
122 126
 		$enabled_feeds = $this->host->get($this, "enabled_feeds");
123
-		if (!is_array($enabled_feeds)) $enabled_feeds = array();
127
+		if (!is_array($enabled_feeds)) {
128
+			$enabled_feeds = array();
129
+		}
124 130
 
125 131
 		$key = array_search($feed_id, $enabled_feeds);
126 132
 		$checked = $key !== FALSE ? "checked" : "";
@@ -137,7 +143,9 @@  discard block
 block discarded – undo
137 143
 
138 144
 	public function hook_prefs_save_feed($feed_id) {
139 145
 		$enabled_feeds = $this->host->get($this, "enabled_feeds");
140
-		if (!is_array($enabled_feeds)) $enabled_feeds = array();
146
+		if (!is_array($enabled_feeds)) {
147
+			$enabled_feeds = array();
148
+		}
141 149
 
142 150
 		$enable = checkbox_to_sql_bool($_POST["af_readability_enabled"]);
143 151
 		$key = array_search($feed_id, $enabled_feeds);
@@ -174,8 +182,9 @@  discard block
 block discarded – undo
174 182
 		if ($tmp && mb_strlen($tmp) < 1024 * 500) {
175 183
 			$tmpdoc = new DOMDocument("1.0", "UTF-8");
176 184
 
177
-			if (!@$tmpdoc->loadHTML($tmp))
178
-				return false;
185
+			if (!@$tmpdoc->loadHTML($tmp)) {
186
+							return false;
187
+			}
179 188
 
180 189
 			// this is the worst hack yet :(
181 190
 			if (strtolower($tmpdoc->encoding) != 'utf-8') {
@@ -237,10 +246,14 @@  discard block
 block discarded – undo
237 246
 	public function hook_article_filter($article) {
238 247
 
239 248
 		$enabled_feeds = $this->host->get($this, "enabled_feeds");
240
-		if (!is_array($enabled_feeds)) return $article;
249
+		if (!is_array($enabled_feeds)) {
250
+			return $article;
251
+		}
241 252
 
242 253
 		$key = array_search($article["feed"]["id"], $enabled_feeds);
243
-		if ($key === FALSE) return $article;
254
+		if ($key === FALSE) {
255
+			return $article;
256
+		}
244 257
 
245 258
 		return $this->process_article($article);
246 259
 
Please login to merge, or discard this patch.
plugins/bookmarklets/init.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -3,21 +3,21 @@
 block discarded – undo
3 3
   private $host;
4 4
 
5 5
   function about() {
6
-    return array(1.0,
6
+	return array(1.0,
7 7
 		 "Easy feed subscription and web page sharing using bookmarklets",
8 8
 		 "fox",
9
-	     false,
9
+		 false,
10 10
 		 "https://git.tt-rss.org/fox/tt-rss/wiki/ShareAnything");
11 11
   }
12 12
 
13 13
   function init($host) {
14
-    $this->host = $host;
14
+	$this->host = $host;
15 15
 
16
-    $host->add_hook($host::HOOK_PREFS_TAB, $this);
16
+	$host->add_hook($host::HOOK_PREFS_TAB, $this);
17 17
   }
18 18
 
19 19
   function hook_prefs_tab($args) {
20
-    if ($args == "prefFeeds") {
20
+	if ($args == "prefFeeds") {
21 21
 
22 22
 		print "<div dojoType=\"dijit.layout.AccordionPane\"
23 23
 			title=\"<i class='material-icons'>bookmark</i> ".__('Bookmarklets')."\">";
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 		print "<div dojoType=\"dijit.layout.AccordionPane\"
23 23
 			title=\"<i class='material-icons'>bookmark</i> ".__('Bookmarklets')."\">";
24 24
 
25
-		print "<h3>" . __("Drag the link below to your browser toolbar, open the feed you're interested in in your browser and click on the link to subscribe to it.") . "</h3>";
25
+		print "<h3>".__("Drag the link below to your browser toolbar, open the feed you're interested in in your browser and click on the link to subscribe to it.")."</h3>";
26 26
 
27 27
 		$bm_subscribe_url = str_replace('%s', '', Pref_Feeds::subscribe_to_feed_url());
28 28
 
@@ -31,14 +31,14 @@  discard block
 block discarded – undo
31 31
 		$bm_url = htmlspecialchars("javascript:{if(confirm('$confirm_str'.replace('%s',window.location.href)))window.location.href='$bm_subscribe_url'+window.location.href}");
32 32
 
33 33
 		print "<p><label class='dijitButton'>";
34
-		print "<a href=\"$bm_url\">" . __('Subscribe in Tiny Tiny RSS'). "</a>";
34
+		print "<a href=\"$bm_url\">".__('Subscribe in Tiny Tiny RSS')."</a>";
35 35
 		print "</label></p>";
36 36
 
37
-		print "<h3>" . __("Use this bookmarklet to publish arbitrary pages using Tiny Tiny RSS") . "</h3>";
37
+		print "<h3>".__("Use this bookmarklet to publish arbitrary pages using Tiny Tiny RSS")."</h3>";
38 38
 
39 39
 		print "<label class='dijitButton'>";
40 40
 		$bm_url = htmlspecialchars("javascript:(function(){var d=document,w=window,e=w.getSelection,k=d.getSelection,x=d.selection,s=(e?e():(k)?k():(x?x.createRange().text:0)),f='".get_self_url_prefix()."/public.php?op=sharepopup',l=d.location,e=encodeURIComponent,g=f+'&title='+((e(s))?e(s):e(document.title))+'&url='+e(l.href);function a(){if(!w.open(g,'t','toolbar=0,resizable=0,scrollbars=1,status=1,width=500,height=250')){l.href=g;}}a();})()");
41
-		print "<a href=\"$bm_url\">" . __('Share with Tiny Tiny RSS'). "</a>";
41
+		print "<a href=\"$bm_url\">".__('Share with Tiny Tiny RSS')."</a>";
42 42
 		print "</label>";
43 43
 
44 44
 		print "<button dojoType='dijit.form.Button' class='alt-info' onclick='window.open(\"https://tt-rss.org/wiki/ShareAnything\")'>
Please login to merge, or discard this patch.
plugins/mailto/init.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 	}
16 16
 
17 17
 	public function get_js() {
18
-		return file_get_contents(dirname(__FILE__) . "/init.js");
18
+		return file_get_contents(dirname(__FILE__)."/init.js");
19 19
 	}
20 20
 
21 21
 	public function hook_article_button($line) {
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 		$sth->execute(array_merge($ids, [$_SESSION['uid']]));
47 47
 
48 48
 		if (count($ids) > 1) {
49
-			$subject = __("[Forwarded]") . " " . __("Multiple articles");
49
+			$subject = __("[Forwarded]")." ".__("Multiple articles");
50 50
 		} else {
51 51
 			$subject = "";
52 52
 		}
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 		while ($line = $sth->fetch()) {
55 55
 
56 56
 			if (!$subject)
57
-				$subject = __("[Forwarded]") . " " . htmlspecialchars($line["title"]);
57
+				$subject = __("[Forwarded]")." ".htmlspecialchars($line["title"]);
58 58
 
59 59
 			$tpl->setVariable('ARTICLE_TITLE', strip_tags($line["title"]));
60 60
 			$tpl->setVariable('ARTICLE_URL', strip_tags($line["link"]));
Please login to merge, or discard this patch.
plugins/note/init.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
 	}
18 18
 
19 19
 	public function get_js() {
20
-		return file_get_contents(dirname(__FILE__) . "/note.js");
20
+		return file_get_contents(dirname(__FILE__)."/note.js");
21 21
 	}
22 22
 
23 23
 
Please login to merge, or discard this patch.
plugins/af_tumblr_1280/init.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,8 +22,9 @@
 block discarded – undo
22 22
 
23 23
 	public function hook_article_filter($article) {
24 24
 
25
-		if (!function_exists("curl_init") || ini_get("open_basedir"))
26
-			return $article;
25
+		if (!function_exists("curl_init") || ini_get("open_basedir")) {
26
+					return $article;
27
+		}
27 28
 
28 29
 		$doc = new DOMDocument();
29 30
 		$doc->loadHTML('<?xml encoding="UTF-8">' . $article["content"]);
Please login to merge, or discard this patch.
plugins/af_unburn/init.php 1 patch
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,8 +21,9 @@  discard block
 block discarded – undo
21 21
 	public function hook_article_filter($article) {
22 22
 		$owner_uid = $article["owner_uid"];
23 23
 
24
-		if (defined('NO_CURL') || !function_exists("curl_init") || ini_get("open_basedir"))
25
-			return $article;
24
+		if (defined('NO_CURL') || !function_exists("curl_init") || ini_get("open_basedir")) {
25
+					return $article;
26
+		}
26 27
 
27 28
 		if ((strpos($article["link"], "feedproxy.google.com") !== FALSE ||
28 29
 		  		strpos($article["link"], "/~r/") !== FALSE ||
@@ -57,7 +58,9 @@  discard block
 block discarded – undo
57 58
 						parse_str($query, $args);
58 59
 
59 60
 						foreach (array("utm_source", "utm_medium", "utm_campaign") as $param) {
60
-							if (isset($args[$param])) unset($args[$param]);
61
+							if (isset($args[$param])) {
62
+								unset($args[$param]);
63
+							}
61 64
 						}
62 65
 
63 66
 						$new_query = http_build_query($args);
Please login to merge, or discard this patch.
plugins/no_title_counters/init.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
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() {
Please login to merge, or discard this patch.
plugins/cache_starred_images/init.php 2 patches
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 	private $host;
6 6
 	/* @var DiskCache $cache */
7 7
 	private $cache;
8
-    private $max_cache_attempts = 5; // per-article
8
+	private $max_cache_attempts = 5; // per-article
9 9
 
10 10
 	public function about() {
11 11
 		return array(1.0,
@@ -158,30 +158,30 @@  discard block
 block discarded – undo
158 158
 
159 159
 		Debug::log("status: $status_filename", Debug::$LOG_VERBOSE);
160 160
 
161
-        if ($this->cache->exists($status_filename))
162
-            $status = json_decode($this->cache->get($status_filename), true);
163
-        else
164
-            $status = [];
161
+		if ($this->cache->exists($status_filename))
162
+			$status = json_decode($this->cache->get($status_filename), true);
163
+		else
164
+			$status = [];
165 165
 
166
-        $status["attempt"] += 1;
166
+		$status["attempt"] += 1;
167 167
 
168
-        // only allow several download attempts for article
169
-        if ($status["attempt"] > $this->max_cache_attempts) {
170
-            Debug::log("too many attempts for $site_url", Debug::$LOG_VERBOSE);
171
-            return false;
172
-        }
168
+		// only allow several download attempts for article
169
+		if ($status["attempt"] > $this->max_cache_attempts) {
170
+			Debug::log("too many attempts for $site_url", Debug::$LOG_VERBOSE);
171
+			return false;
172
+		}
173 173
 
174
-        if (!$this->cache->put($status_filename, json_encode($status))) {
175
-            user_error("unable to write status file: $status_filename", E_USER_WARNING);
176
-            return false;
177
-        }
174
+		if (!$this->cache->put($status_filename, json_encode($status))) {
175
+			user_error("unable to write status file: $status_filename", E_USER_WARNING);
176
+			return false;
177
+		}
178 178
 
179 179
 		$doc = new DOMDocument();
180 180
 
181 181
 		$has_images = false;
182 182
 		$success = false;
183 183
 
184
-        if ($doc->loadHTML('<?xml encoding="UTF-8">' . $content)) {
184
+		if ($doc->loadHTML('<?xml encoding="UTF-8">' . $content)) {
185 185
 			$xpath = new DOMXPath($doc);
186 186
 			$entries = $xpath->query('(//img[@src])|(//video/source[@src])');
187 187
 
@@ -203,11 +203,11 @@  discard block
 block discarded – undo
203 203
 		$esth = $this->pdo->prepare("SELECT content_url FROM ttrss_enclosures WHERE post_id = ? AND
204 204
 			(content_type LIKE '%image%' OR content_type LIKE '%video%')");
205 205
 
206
-        if ($esth->execute([$article_id])) {
207
-        	while ($enc = $esth->fetch()) {
206
+		if ($esth->execute([$article_id])) {
207
+			while ($enc = $esth->fetch()) {
208 208
 
209
-        		$has_images = true;
210
-        		$url = rewrite_relative_url($site_url, $enc["content_url"]);
209
+				$has_images = true;
210
+				$url = rewrite_relative_url($site_url, $enc["content_url"]);
211 211
 
212 212
 				if ($this->cache_url($article_id, $url)) {
213 213
 					$success = true;
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 	public function hook_house_keeping() {
36 36
 		/* since HOOK_UPDATE_TASK is not available to user plugins, this hook is a next best thing */
37 37
 
38
-		Debug::log("caching media of starred articles for user " . $this->host->get_owner_uid() . "...");
38
+		Debug::log("caching media of starred articles for user ".$this->host->get_owner_uid()."...");
39 39
 
40 40
 		$sth = $this->pdo->prepare("SELECT content, ttrss_entries.title,
41 41
        		ttrss_user_entries.owner_uid, link, site_url, ttrss_entries.id, plugin_data
@@ -53,13 +53,13 @@  discard block
 block discarded – undo
53 53
 			$usth = $this->pdo->prepare("UPDATE ttrss_entries SET plugin_data = ? WHERE id = ?");
54 54
 
55 55
 			while ($line = $sth->fetch()) {
56
-				Debug::log("processing article " . $line["title"], Debug::$LOG_VERBOSE);
56
+				Debug::log("processing article ".$line["title"], Debug::$LOG_VERBOSE);
57 57
 
58 58
 				if ($line["site_url"]) {
59 59
 					$success = $this->cache_article_images($line["content"], $line["site_url"], $line["owner_uid"], $line["id"]);
60 60
 
61 61
 					if ($success) {
62
-						$plugin_data = "starred_cache_images,${line['owner_uid']}:" . $line["plugin_data"];
62
+						$plugin_data = "starred_cache_images,${line['owner_uid']}:".$line["plugin_data"];
63 63
 
64 64
 						$usth->execute([$plugin_data, $line['id']]);
65 65
 					}
@@ -69,9 +69,9 @@  discard block
 block discarded – undo
69 69
 
70 70
 		/* actual housekeeping */
71 71
 
72
-		Debug::log("expiring " . $this->cache->getDir() . "...");
72
+		Debug::log("expiring ".$this->cache->getDir()."...");
73 73
 
74
-		$files = glob($this->cache->getDir() . "/*.{png,mp4,status}", GLOB_BRACE);
74
+		$files = glob($this->cache->getDir()."/*.{png,mp4,status}", GLOB_BRACE);
75 75
 
76 76
 		$last_article_id = 0;
77 77
 		$article_exists = 1;
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 	}
96 96
 
97 97
 	public function hook_enclosure_entry($enc, $article_id) {
98
-		$local_filename = $article_id . "-" . sha1($enc["content_url"]);
98
+		$local_filename = $article_id."-".sha1($enc["content_url"]);
99 99
 
100 100
 		if ($this->cache->exists($local_filename)) {
101 101
 			$enc["content_url"] = $this->cache->getUrl($local_filename);
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 				if ($entry->hasAttribute('src')) {
115 115
 					$src = rewrite_relative_url($site_url, $entry->getAttribute('src'));
116 116
 
117
-					$local_filename = $article_id . "-" . sha1($src);
117
+					$local_filename = $article_id."-".sha1($src);
118 118
 
119 119
 					if ($this->cache->exists($local_filename)) {
120 120
 						$entry->setAttribute("src", $this->cache->getUrl($local_filename));
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 	}
129 129
 
130 130
 	private function cache_url($article_id, $url) {
131
-		$local_filename = $article_id . "-" . sha1($url);
131
+		$local_filename = $article_id."-".sha1($url);
132 132
 
133 133
 		if (!$this->cache->exists($local_filename)) {
134 134
 			Debug::log("cache_images: downloading: $url to $local_filename", Debug::$LOG_VERBOSE);
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 			$data = fetch_file_contents(["url" => $url, "max_size" => MAX_CACHE_FILE_SIZE]);
137 137
 
138 138
 			if ($data)
139
-				return $this->cache->put($local_filename, $data);;
139
+				return $this->cache->put($local_filename, $data); ;
140 140
 
141 141
 		} else {
142 142
 			//Debug::log("cache_images: local file exists for $url", Debug::$LOG_VERBOSE);
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 	}
149 149
 
150 150
 	private function cache_article_images($content, $site_url, $owner_uid, $article_id) {
151
-		$status_filename = $article_id . "-" . sha1($site_url) . ".status";
151
+		$status_filename = $article_id."-".sha1($site_url).".status";
152 152
 
153 153
 		/* housekeeping might run as a separate user, in this case status/media might not be writable */
154 154
 		if (!$this->cache->isWritable($status_filename)) {
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 		$has_images = false;
182 182
 		$success = false;
183 183
 
184
-        if ($doc->loadHTML('<?xml encoding="UTF-8">' . $content)) {
184
+        if ($doc->loadHTML('<?xml encoding="UTF-8">'.$content)) {
185 185
 			$xpath = new DOMXPath($doc);
186 186
 			$entries = $xpath->query('(//img[@src])|(//video/source[@src])');
187 187
 
Please login to merge, or discard this patch.
plugins/share/init.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -17,15 +17,15 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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";
Please login to merge, or discard this patch.