@@ -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; |
@@ -60,14 +60,14 @@ discard block |
||
60 | 60 | $line[$k] = htmlspecialchars($v); |
61 | 61 | } |
62 | 62 | |
63 | - print "<td class='errno'>" . Logger::$errornames[$line["errno"]] . " (" . $line["errno"] . ")</td>"; |
|
64 | - print "<td class='filename'>" . $line["filename"] . ":" . $line["lineno"] . "</td>"; |
|
65 | - print "<td class='errstr'>" . $line["errstr"] . "<hr/>" . nl2br($line["context"]) . "</td>"; |
|
66 | - print "<td class='login'>" . $line["login"] . "</td>"; |
|
63 | + print "<td class='errno'>".Logger::$errornames[$line["errno"]]." (".$line["errno"].")</td>"; |
|
64 | + print "<td class='filename'>".$line["filename"].":".$line["lineno"]."</td>"; |
|
65 | + print "<td class='errstr'>".$line["errstr"]."<hr/>".nl2br($line["context"])."</td>"; |
|
66 | + print "<td class='login'>".$line["login"]."</td>"; |
|
67 | 67 | |
68 | - print "<td class='timestamp'>" . |
|
68 | + print "<td class='timestamp'>". |
|
69 | 69 | make_local_datetime( |
70 | - $line["created_at"], false) . "</td>"; |
|
70 | + $line["created_at"], false)."</td>"; |
|
71 | 71 | |
72 | 72 | print "</tr>"; |
73 | 73 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | ob_end_clean(); |
91 | 91 | |
92 | 92 | print "<div class='phpinfo'>"; |
93 | - print preg_replace( '%^.*<body>(.*)</body>.*$%ms','$1', $info); |
|
93 | + print preg_replace('%^.*<body>(.*)</body>.*$%ms', '$1', $info); |
|
94 | 94 | print "</div>"; |
95 | 95 | |
96 | 96 | print "</div>"; |