These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | header('Content-Type: text/html;charset=utf-8'); |
||
3 | ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
||
4 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> |
||
5 | <?php |
||
6 | /** |
||
7 | * COPS (Calibre OPDS PHP Server) epub reader |
||
8 | * |
||
9 | * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) |
||
10 | * @author Sébastien Lucas <[email protected]> |
||
11 | */ |
||
12 | |||
13 | require_once 'config.php'; |
||
14 | require_once 'base.php'; |
||
15 | |||
16 | $idData = getURLParam('data', NULL); |
||
17 | $add = 'data=' . $idData . '&'; |
||
18 | if (!is_null (GetUrlParam (DB))) { |
||
19 | $add .= DB . '=' . GetUrlParam (DB) . '&'; |
||
20 | } |
||
21 | $myBook = Book::getBookByDataId($idData); |
||
22 | |||
23 | $book = new EPub($myBook->getFilePath('EPUB', $idData)); |
||
24 | $book->initSpineComponent(); |
||
25 | |||
26 | ?> |
||
27 | <head> |
||
28 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
||
29 | <meta http-equiv="imagetoolbar" content="no" /> |
||
30 | <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> |
||
31 | <title>COPS's Epub Reader</title> |
||
32 | <script type="text/javascript" src="<?php echo getUrlWithVersion("resources/monocle/scripts/monocore.js") ?>"></script> |
||
0 ignored issues
–
show
|
|||
33 | <script type="text/javascript" src="<?php echo getUrlWithVersion("resources/monocle/scripts/monoctrl.js") ?>"></script> |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
resources/monocle/scripts/monoctrl.js does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
34 | <link rel="stylesheet" type="text/css" href="<?php echo getUrlWithVersion("resources/monocle/styles/monocore.css") ?>" media="screen" /> |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
resources/monocle/styles/monocore.css does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
35 | <link rel="stylesheet" type="text/css" href="<?php echo getUrlWithVersion("resources/monocle/styles/monoctrl.css") ?>" media="screen" /> |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
resources/monocle/styles/monoctrl.css does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
36 | <script type="text/javascript"> |
||
37 | Monocle.DEBUG = true; |
||
38 | var bookData = { |
||
39 | getComponents: function() { |
||
40 | <?php echo 'return [' . implode(', ', array_map(function($comp) { return "'" . $comp . "'"; }, $book->components ())) . '];'; ?> |
||
0 ignored issues
–
show
|
|||
41 | }, |
||
42 | getContents: function() { |
||
43 | <?php echo 'return [' . implode(', ', array_map(function($content) { return "{title: '" . addslashes($content['title']) . "', src: '". $content['src'] . "'}"; }, $book->contents())) . '];'; ?> |
||
0 ignored issues
–
show
|
|||
44 | }, |
||
45 | getComponent: function (componentId) { |
||
46 | return { url: "epubfs.php?<?php echo $add ?>comp=" + componentId }; |
||
47 | }, |
||
48 | getMetaData: function(key) { |
||
49 | return { |
||
50 | title: "<?php echo $myBook->title ?>", |
||
51 | creator: "Inventive Labs" |
||
52 | }[key]; |
||
53 | } |
||
54 | } |
||
55 | |||
56 | </script> |
||
57 | <script type="text/javascript" src="<?php echo getUrlWithVersion("styles/cops-monocle.js") ?>"></script> |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
styles/cops-monocle.js does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
58 | <link rel="stylesheet" type="text/css" href="<?php echo getUrlWithVersion("styles/cops-monocle.css") ?>" media="screen" /> |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
The string literal
styles/cops-monocle.css does not require double quotes, as per coding-style, please use single quotes.
PHP provides two ways to mark string literals. Either with single quotes String literals in single quotes on the other hand are evaluated very literally and the only two
characters that needs escaping in the literal are the single quote itself ( Double quoted string literals may contain other variables or more complex escape sequences. <?php
$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";
print $doubleQuoted;
will print an indented: If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear. For more information on PHP string literals and available escape sequences see the PHP core documentation. ![]() |
|||
59 | <link rel="icon" type="image/x-icon" href="favicon.ico" /> |
||
60 | </head> |
||
61 | <body> |
||
62 | <div id="readerBg"> |
||
63 | <div class="board"></div> |
||
64 | <div class="jacket"></div> |
||
65 | <div class="dummyPage"></div> |
||
66 | <div class="dummyPage"></div> |
||
67 | <div class="dummyPage"></div> |
||
68 | <div class="dummyPage"></div> |
||
69 | <div class="dummyPage"></div> |
||
70 | </div> |
||
71 | <div id="readerCntr"> |
||
72 | <div id="reader"></div> |
||
73 | </div> |
||
74 | </body> |
||
75 | </html> |
||
76 |
PHP provides two ways to mark string literals. Either with single quotes
'literal'
or with double quotes"literal"
. The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (
\'
) and the backslash (\\
). Every other character is displayed as is.Double quoted string literals may contain other variables or more complex escape sequences.
will print an indented:
Single is Value
If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.
For more information on PHP string literals and available escape sequences see the PHP core documentation.