@@ -57,13 +57,13 @@ discard block |
||
57 | 57 | print "<fieldset class='narrow'>"; |
58 | 58 | print "<label class='checkbox'>"; |
59 | 59 | print_checkbox("enable_readability", $enable_readability); |
60 | - print " " . __("Extract missing content using Readability (requires af_readability)") . "</label>"; |
|
60 | + print " ".__("Extract missing content using Readability (requires af_readability)")."</label>"; |
|
61 | 61 | print "</fieldset>"; |
62 | 62 | |
63 | 63 | print "<fieldset class='narrow'>"; |
64 | 64 | print "<label class='checkbox'>"; |
65 | 65 | print_checkbox("enable_content_dupcheck", $enable_content_dupcheck); |
66 | - print " " . __("Enable additional duplicate checking") . "</label>"; |
|
66 | + print " ".__("Enable additional duplicate checking")."</label>"; |
|
67 | 67 | print "</fieldset>"; |
68 | 68 | |
69 | 69 | print_button("submit", __("Save"), 'class="alt-primary"'); |
@@ -96,14 +96,14 @@ discard block |
||
96 | 96 | foreach ($entries as $entry) { |
97 | 97 | if ($entry->hasAttribute("href") && strpos($entry->getAttribute("href"), "reddit.com") === FALSE) { |
98 | 98 | |
99 | - Debug::log("processing href: " . $entry->getAttribute("href"), Debug::$LOG_VERBOSE); |
|
99 | + Debug::log("processing href: ".$entry->getAttribute("href"), Debug::$LOG_VERBOSE); |
|
100 | 100 | |
101 | 101 | $matches = array(); |
102 | 102 | |
103 | 103 | if (!$found && preg_match("/^https?:\/\/twitter.com\/(.*?)\/status\/(.*)/", $entry->getAttribute("href"), $matches)) { |
104 | - Debug::log("handling as twitter: " . $matches[1] . " " . $matches[2], Debug::$LOG_VERBOSE); |
|
104 | + Debug::log("handling as twitter: ".$matches[1]." ".$matches[2], Debug::$LOG_VERBOSE); |
|
105 | 105 | |
106 | - $oembed_result = fetch_file_contents("https://publish.twitter.com/oembed?url=" . urlencode($entry->getAttribute("href"))); |
|
106 | + $oembed_result = fetch_file_contents("https://publish.twitter.com/oembed?url=".urlencode($entry->getAttribute("href"))); |
|
107 | 107 | |
108 | 108 | if ($oembed_result) { |
109 | 109 | $oembed_result = json_decode($oembed_result, true); |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | if ($oembed_result && isset($oembed_result["html"])) { |
112 | 112 | |
113 | 113 | $tmp = new DOMDocument(); |
114 | - if ($tmp->loadHTML('<?xml encoding="utf-8" ?>' . $oembed_result["html"])) { |
|
114 | + if ($tmp->loadHTML('<?xml encoding="utf-8" ?>'.$oembed_result["html"])) { |
|
115 | 115 | $p = $doc->createElement("p"); |
116 | 116 | |
117 | 117 | $p->appendChild($doc->importNode( |
@@ -135,8 +135,8 @@ discard block |
||
135 | 135 | |
136 | 136 | Debug::log("Handling as Gfycat", Debug::$LOG_VERBOSE); |
137 | 137 | |
138 | - $source_stream = 'https://giant.gfycat.com/' . $matches[2] . '.mp4'; |
|
139 | - $poster_url = 'https://thumbs.gfycat.com/' . $matches[2] . '-mobile.jpg'; |
|
138 | + $source_stream = 'https://giant.gfycat.com/'.$matches[2].'.mp4'; |
|
139 | + $poster_url = 'https://thumbs.gfycat.com/'.$matches[2].'-mobile.jpg'; |
|
140 | 140 | |
141 | 141 | $content_type = $this->get_content_type($source_stream); |
142 | 142 | |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | } |
185 | 185 | |
186 | 186 | if (!$source_stream) { |
187 | - $source_stream = "https://v.redd.it/" . $matches[1] . "/DASH_600_K"; |
|
187 | + $source_stream = "https://v.redd.it/".$matches[1]."/DASH_600_K"; |
|
188 | 188 | } |
189 | 189 | |
190 | 190 | $this->handle_as_video($doc, $entry, $source_stream, $poster_url); |
@@ -542,7 +542,7 @@ discard block |
||
542 | 542 | |
543 | 543 | // do not try to embed posts linking back to other reddit posts |
544 | 544 | // readability.php requires PHP 5.6 |
545 | - if ($url && strpos($url, "reddit.com") === FALSE && version_compare(PHP_VERSION, '5.6.0', '>=')) { |
|
545 | + if ($url && strpos($url, "reddit.com") === FALSE && version_compare(PHP_VERSION, '5.6.0', '>=')) { |
|
546 | 546 | |
547 | 547 | /* link may lead to a huge video file or whatever, we need to check content type before trying to |
548 | 548 | parse it which p much requires curl */ |
@@ -54,7 +54,7 @@ |
||
54 | 54 | $i->parentNode->removeChild($i); |
55 | 55 | } |
56 | 56 | |
57 | - if ($basenode){ |
|
57 | + if ($basenode) { |
|
58 | 58 | $article["content"] = $doc->saveHTML($basenode); |
59 | 59 | } |
60 | 60 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | foreach ($matches as $tag) { |
38 | 38 | // Only strings starting with a number sign are considered tags |
39 | - if ( substr($tag->textContent, 0, 1) == '#' ) { |
|
39 | + if (substr($tag->textContent, 0, 1) == '#') { |
|
40 | 40 | $tags[] = mb_strtolower(substr($tag->textContent, 1), 'utf-8'); |
41 | 41 | } |
42 | 42 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | |
55 | 55 | // Add comic title to article type if not empty (mostly Sunday strips) |
56 | 56 | if ($comic_title) { |
57 | - $article["title"] = $article["title"] . " - " . $comic_title; |
|
57 | + $article["title"] = $article["title"]." - ".$comic_title; |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | if (!empty($tags)) { |
@@ -19,7 +19,7 @@ |
||
19 | 19 | |
20 | 20 | $doc = new DOMDocument(); |
21 | 21 | |
22 | - @$doc->loadHTML('<?xml encoding="UTF-8">' . $article["content"]); |
|
22 | + @$doc->loadHTML('<?xml encoding="UTF-8">'.$article["content"]); |
|
23 | 23 | |
24 | 24 | if ($doc) { |
25 | 25 | $xpath = new DOMXPath($doc); |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | |
20 | 20 | private function legacy_connect() { |
21 | 21 | |
22 | - user_error("Legacy connect requested to " . DB_TYPE, E_USER_NOTICE); |
|
22 | + user_error("Legacy connect requested to ".DB_TYPE, E_USER_NOTICE); |
|
23 | 23 | |
24 | 24 | $er = error_reporting(E_ALL); |
25 | 25 | |
@@ -31,18 +31,18 @@ discard block |
||
31 | 31 | $this->adapter = new Db_Pgsql(); |
32 | 32 | break; |
33 | 33 | default: |
34 | - die("Unknown DB_TYPE: " . DB_TYPE); |
|
34 | + die("Unknown DB_TYPE: ".DB_TYPE); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | if (!$this->adapter) { |
38 | - print("Error initializing database adapter for " . DB_TYPE); |
|
38 | + print("Error initializing database adapter for ".DB_TYPE); |
|
39 | 39 | exit(100); |
40 | 40 | } |
41 | 41 | |
42 | 42 | $this->link = $this->adapter->connect(DB_HOST, DB_USER, DB_PASS, DB_NAME, defined('DB_PORT') ? DB_PORT : ""); |
43 | 43 | |
44 | 44 | if (!$this->link) { |
45 | - print("Error connecting through adapter: " . $this->adapter->last_error()); |
|
45 | + print("Error connecting through adapter: ".$this->adapter->last_error()); |
|
46 | 46 | exit(101); |
47 | 47 | } |
48 | 48 | |
@@ -53,15 +53,15 @@ discard block |
||
53 | 53 | // normal usage is Db::pdo()->prepare(...) etc |
54 | 54 | public function pdo_connect() { |
55 | 55 | |
56 | - $db_port = defined('DB_PORT') && DB_PORT ? ';port=' . DB_PORT : ''; |
|
57 | - $db_host = defined('DB_HOST') && DB_HOST ? ';host=' . DB_HOST : ''; |
|
56 | + $db_port = defined('DB_PORT') && DB_PORT ? ';port='.DB_PORT : ''; |
|
57 | + $db_host = defined('DB_HOST') && DB_HOST ? ';host='.DB_HOST : ''; |
|
58 | 58 | |
59 | 59 | try { |
60 | - $pdo = new PDO(DB_TYPE . ':dbname=' . DB_NAME . $db_host . $db_port, |
|
60 | + $pdo = new PDO(DB_TYPE.':dbname='.DB_NAME.$db_host.$db_port, |
|
61 | 61 | DB_USER, |
62 | 62 | DB_PASS); |
63 | 63 | } catch (Exception $e) { |
64 | - print "<pre>Exception while creating PDO object:" . $e->getMessage() . "</pre>"; |
|
64 | + print "<pre>Exception while creating PDO object:".$e->getMessage()."</pre>"; |
|
65 | 65 | exit(101); |
66 | 66 | } |
67 | 67 | |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $pdo->query("SET time_zone = '+0:0'"); |
79 | 79 | |
80 | 80 | if (defined('MYSQL_CHARSET') && MYSQL_CHARSET) { |
81 | - $pdo->query("SET NAMES " . MYSQL_CHARSET); |
|
81 | + $pdo->query("SET NAMES ".MYSQL_CHARSET); |
|
82 | 82 | } |
83 | 83 | } |
84 | 84 |
@@ -38,7 +38,7 @@ |
||
38 | 38 | return 0; |
39 | 39 | } |
40 | 40 | |
41 | - $headers = [ "From: $from_combined", "Content-Type: text/plain; charset=UTF-8" ]; |
|
41 | + $headers = ["From: $from_combined", "Content-Type: text/plain; charset=UTF-8"]; |
|
42 | 42 | |
43 | 43 | return mail($to_combined, $subject, $message, implode("\r\n", array_merge($headers, $additional_headers))); |
44 | 44 | } |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | if ($type_name == "bool") { |
103 | 103 | return $value == "true"; |
104 | 104 | } else if ($type_name == "integer") { |
105 | - return (int)$value; |
|
105 | + return (int) $value; |
|
106 | 106 | } else { |
107 | 107 | return $value; |
108 | 108 | } |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | $value = "false"; |
150 | 150 | } |
151 | 151 | } else if ($type_name == "integer") { |
152 | - $value = (int)$value; |
|
152 | + $value = (int) $value; |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | if ($pref_name == 'USER_TIMEZONE' && $value == '') { |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | |
15 | 15 | return $this->link; |
16 | 16 | } else { |
17 | - print("Unable to connect to database (as $user to $host, database $db): " . mysqli_connect_error()); |
|
17 | + print("Unable to connect to database (as $user to $host, database $db): ".mysqli_connect_error()); |
|
18 | 18 | exit(102); |
19 | 19 | } |
20 | 20 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $this->last_error = @mysqli_error($this->link); |
32 | 32 | |
33 | 33 | @mysqli_query($this->link, "ROLLBACK"); |
34 | - user_error("Query $query failed: " . ($this->link ? $this->last_error : "No connection"), |
|
34 | + user_error("Query $query failed: ".($this->link ? $this->last_error : "No connection"), |
|
35 | 35 | $die_on_error ? E_USER_ERROR : E_USER_WARNING); |
36 | 36 | } |
37 | 37 |
@@ -15,13 +15,13 @@ discard block |
||
15 | 15 | } |
16 | 16 | |
17 | 17 | if (is_numeric($port) && $port > 0) { |
18 | - $string = "$string port=" . $port; |
|
18 | + $string = "$string port=".$port; |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | $this->link = pg_connect($string); |
22 | 22 | |
23 | 23 | if (!$this->link) { |
24 | - print("Unable to connect to database (as $user to $host, database $db):" . pg_last_error()); |
|
24 | + print("Unable to connect to database (as $user to $host, database $db):".pg_last_error()); |
|
25 | 25 | exit(102); |
26 | 26 | } |
27 | 27 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | |
45 | 45 | @pg_query($this->link, "ROLLBACK"); |
46 | 46 | $query = htmlspecialchars($query); // just in case |
47 | - user_error("Query $query failed: " . ($this->link ? $this->last_error : "No connection"), |
|
47 | + user_error("Query $query failed: ".($this->link ? $this->last_error : "No connection"), |
|
48 | 48 | $die_on_error ? E_USER_ERROR : E_USER_WARNING); |
49 | 49 | } |
50 | 50 | return $result; |