Completed
Push — master ( d7e1eb...92ab4e )
by Markus
04:16
created
index.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -37,14 +37,14 @@
 block discarded – undo
37 37
     header('Content-Type:text/html;charset=utf-8');
38 38
 
39 39
     $data = array('title'                 => $config['cops_title_default'],
40
-                  'version'               => VERSION,
41
-                  'opds_url'              => $config['cops_full_url'] . 'feed.php',
42
-                  'customHeader'          => '',
43
-                  'template'              => getCurrentTemplate(),
44
-                  'server_side_rendering' => useServerSideRendering(),
45
-                  'current_css'           => getCurrentCss(),
46
-                  'favico'                => $config['cops_icon'],
47
-                  'getjson_url'           => 'getJSON.php?' . addURLParameter(getQueryString(), 'complete', 1));
40
+                    'version'               => VERSION,
41
+                    'opds_url'              => $config['cops_full_url'] . 'feed.php',
42
+                    'customHeader'          => '',
43
+                    'template'              => getCurrentTemplate(),
44
+                    'server_side_rendering' => useServerSideRendering(),
45
+                    'current_css'           => getCurrentCss(),
46
+                    'favico'                => $config['cops_icon'],
47
+                    'getjson_url'           => 'getJSON.php?' . addURLParameter(getQueryString(), 'complete', 1));
48 48
     if (preg_match('/Kindle/', $_SERVER['HTTP_USER_AGENT'])) {
49 49
         $data['customHeader'] = '<style media="screen" type="text/css"> html { font-size: 75%; -webkit-text-size-adjust: 75%; -ms-text-size-adjust: 75%; }</style>';
50 50
     }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
     }
51 51
     $headcontent = file_get_contents('templates/' . getCurrentTemplate() . '/file.html');
52 52
     $template = new doT();
53
-    $dot = $template->template($headcontent, NULL);
53
+    $dot = $template->template($headcontent, null);
54 54
     echo($dot($data));
55 55
 ?><body>
56 56
 <?php
Please login to merge, or discard this patch.
epubreader.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,8 +15,8 @@  discard block
 block discarded – undo
15 15
 
16 16
 $idData = getURLParam('data', NULL);
17 17
 $add = 'data=' . $idData . '&';
18
-if (!is_null (GetUrlParam (DB))) {
19
-    $add .= DB . '=' . GetUrlParam (DB) . '&';
18
+if (!is_null(GetUrlParam(DB))) {
19
+    $add .= DB . '=' . GetUrlParam(DB) . '&';
20 20
 }
21 21
 $myBook = Book::getBookByDataId($idData);
22 22
 
@@ -37,10 +37,10 @@  discard block
 block discarded – undo
37 37
         Monocle.DEBUG = true;
38 38
         var bookData = {
39 39
           getComponents: function() {
40
-            <?php echo 'return [' . implode(', ', array_map(function($comp) { return "'" . $comp . "'"; }, $book->components ())) . '];'; ?>
40
+            <?php echo 'return [' . implode(', ', array_map(function($comp) { return "'" . $comp . "'"; }, $book->components())) . '];'; ?>
41 41
           },
42 42
           getContents: function() {
43
-            <?php echo 'return [' . implode(', ', array_map(function($content) { return "{title: '" . addslashes($content['title']) . "', src: '". $content['src'] . "'}"; }, $book->contents())) . '];'; ?>
43
+            <?php echo 'return [' . implode(', ', array_map(function($content) { return "{title: '" . addslashes($content['title']) . "', src: '" . $content['src'] . "'}"; }, $book->contents())) . '];'; ?>
44 44
           },
45 45
           getComponent: function (componentId) {
46 46
             return { url: "epubfs.php?<?php echo $add ?>comp="  + componentId };
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 
14 14
 header('Content-Type: text/html;charset=utf-8');
15 15
 
16
-$idData = getURLParam('data', NULL);
16
+$idData = getURLParam('data', null);
17 17
 $add = 'data=' . $idData . '&';
18 18
 if (!is_null (GetUrlParam (DB))) {
19 19
     $add .= DB . '=' . GetUrlParam (DB) . '&';
Please login to merge, or discard this patch.
config.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,20 +12,20 @@
 block discarded – undo
12 12
     require_once dirname(__FILE__) . '/config_local.php';
13 13
 }
14 14
 
15
-$remote_user = array_key_exists('PHP_AUTH_USER', $_SERVER) ? $_SERVER['PHP_AUTH_USER'] : '';
15
+$remote_user = array_key_exists('PHP_AUTH_USER', $_SERVER)?$_SERVER['PHP_AUTH_USER']:'';
16 16
 // Clean username, only allow a-z, A-Z, 0-9, -_ chars
17
-$remote_user = preg_replace( '/[^a-zA-Z0-9_-]/', '', $remote_user);
17
+$remote_user = preg_replace('/[^a-zA-Z0-9_-]/', '', $remote_user);
18 18
 $user_config_file = 'config_local.' . $remote_user . '.php';
19 19
 if (file_exists(dirname(__FILE__) . '/' . $user_config_file) && (php_sapi_name() !== 'cli')) {
20 20
     require_once dirname(__FILE__) . '/' . $user_config_file;
21 21
 }
22 22
 
23
-if(!is_null($config['cops_basic_authentication']) &&
23
+if (!is_null($config['cops_basic_authentication']) &&
24 24
     is_array($config['cops_basic_authentication']))
25 25
 {
26 26
     if (!isset($_SERVER['PHP_AUTH_USER']) ||
27 27
         (isset($_SERVER['PHP_AUTH_USER']) &&
28
-        ($_SERVER['PHP_AUTH_USER']!=$config['cops_basic_authentication']['username'] ||
28
+        ($_SERVER['PHP_AUTH_USER'] != $config['cops_basic_authentication']['username'] ||
29 29
         $_SERVER['PHP_AUTH_PW'] != $config['cops_basic_authentication']['password'])))
30 30
     {
31 31
         header('WWW-Authenticate: Basic realm="COPS Authentication"');
Please login to merge, or discard this patch.
epubfs.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -72,11 +72,11 @@
 block discarded – undo
72 72
 try {
73 73
     $data = getComponentContent($book, $component, $add);
74 74
 
75
-    $expires = 60*60*24*14;
75
+    $expires = 60 * 60 * 24 * 14;
76 76
     header('Pragma: public');
77
-    header('Cache-Control: maxage='.$expires);
78
-    header('Expires: ' . gmdate('D, d M Y H:i:s', time()+$expires) . ' GMT');
79
-    header ('Content-Type: ' . $book->componentContentType($component));
77
+    header('Cache-Control: maxage=' . $expires);
78
+    header('Expires: ' . gmdate('D, d M Y H:i:s', time() + $expires) . ' GMT');
79
+    header('Content-Type: ' . $book->componentContentType($component));
80 80
     echo $data;
81 81
 } catch (Exception $e) {
82 82
     error_log($e);
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
     return;
52 52
 }
53 53
 
54
-$idData = getURLParam('data', NULL);
54
+$idData = getURLParam('data', null);
55 55
 $add = 'data=' . $idData . '&';
56 56
 if (!is_null(GetUrlParam(DB))) {
57 57
     $add .= DB . '=' . GetUrlParam(DB) . '&';
Please login to merge, or discard this patch.
checkconfig.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
     require_once 'config.php';
13 13
     require_once 'base.php';
14 14
 
15
-    header ('Content-Type:text/html; charset=UTF-8');
15
+    header('Content-Type:text/html; charset=UTF-8');
16 16
 
17 17
     $err = getURLParam('err', -1);
18 18
     $full = getURLParam('full');
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
     <meta charset="utf-8">
29 29
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
30 30
     <title>COPS Configuration Check</title>
31
-    <link rel="stylesheet" type="text/css" href="<?php echo getUrlWithVersion(getCurrentCss ()) ?>" media="screen" />
31
+    <link rel="stylesheet" type="text/css" href="<?php echo getUrlWithVersion(getCurrentCss()) ?>" media="screen" />
32 32
 </head>
33 33
 <body>
34 34
 <div class="container">
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
             <h2>Check if the rendering will be done on client side or server side</h2>
154 154
             <h4>
155 155
             <?php
156
-            if (useServerSideRendering ()) {
156
+            if (useServerSideRendering()) {
157 157
                 echo 'Server side rendering';
158 158
             } else {
159 159
                 echo 'Client side rendering';
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
             <h2>Check if Calibre database path is not an URL</h2>
170 170
             <h4>
171 171
             <?php
172
-            if (!preg_match ('#^http#', $database)) {
172
+            if (!preg_match('#^http#', $database)) {
173 173
                 echo 'OK';
174 174
             } else {
175 175
                 echo 'Calibre path has to be local (no URL allowed)';
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
             <h4>
203 203
             <?php
204 204
             try {
205
-                $db = new PDO('sqlite:'. Base::getDbFileName($i));
205
+                $db = new PDO('sqlite:' . Base::getDbFileName($i));
206 206
                 echo $name . ' OK';
207 207
             } catch (Exception $e) {
208 208
                 echo $name . ' If the file is readable, check your php configuration. Exception detail : ' . $e;
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
             <h4>
216 216
             <?php
217 217
             try {
218
-                $db = new PDO('sqlite:'. Base::getDbFileName($i));
218
+                $db = new PDO('sqlite:' . Base::getDbFileName($i));
219 219
                 $count = $db->query('select count(*) FROM sqlite_master WHERE type="table" AND name in ("books", "authors", "tags", "series")')->fetchColumn();
220 220
                 if ($count == 4) {
221 221
                     echo $name . ' OK';
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
                 $result->execute();
240 240
                 while ($post = $result->fetchObject())
241 241
                 {
242
-                    if (!is_file (Base::getDbDirectory($i) . $post->fullpath)) {
242
+                    if (!is_file(Base::getDbDirectory($i) . $post->fullpath)) {
243 243
                         echo '<p>' . Base::getDbDirectory($i) . $post->fullpath . '</p>';
244 244
                     }
245 245
                 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -237,8 +237,7 @@
 block discarded – undo
237 237
                 $db = new PDO('sqlite:' . Base::getDbFileName($i));
238 238
                 $result = $db->prepare('select books.path || "/" || data.name || "." || lower (format) as fullpath from data join books on data.book = books.id');
239 239
                 $result->execute();
240
-                while ($post = $result->fetchObject())
241
-                {
240
+                while ($post = $result->fetchObject()) {
242 241
                     if (!is_file (Base::getDbDirectory($i) . $post->fullpath)) {
243 242
                         echo '<p>' . Base::getDbDirectory($i) . $post->fullpath . '</p>';
244 243
                     }
Please login to merge, or discard this patch.