@@ -109,7 +109,7 @@ |
||
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | if ($mimeTypeConstantValue == IMAGETYPE_PNG) { |
| 112 | - return imagepng($imageResource, $path, ((int)($quality / 10) - 1)); |
|
| 112 | + return imagepng($imageResource, $path, ((int) ($quality / 10) - 1)); |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | throw new \RuntimeException('Not a valid mimetypeconstant given see function documentation'); |
@@ -65,9 +65,9 @@ discard block |
||
| 65 | 65 | { |
| 66 | 66 | if (!isset($_GET['unsanitized'])) { |
| 67 | 67 | $search = array( |
| 68 | - '/\>[^\S ]+/s', // strip whitespaces after tags, except space |
|
| 69 | - '/[^\S ]+\</s', // strip whitespaces before tags, except space |
|
| 70 | - '/(\s)+/s', // shorten multiple whitespace sequences |
|
| 68 | + '/\>[^\S ]+/s', // strip whitespaces after tags, except space |
|
| 69 | + '/[^\S ]+\</s', // strip whitespaces before tags, except space |
|
| 70 | + '/(\s)+/s', // shorten multiple whitespace sequences |
|
| 71 | 71 | '/<!--(.|\s)*?-->/' // Remove HTML comments |
| 72 | 72 | ); |
| 73 | 73 | |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | */ |
| 95 | 95 | public static function utf8Convert($array) |
| 96 | 96 | { |
| 97 | - array_walk_recursive($array, function (&$item) { |
|
| 97 | + array_walk_recursive($array, function(&$item) { |
|
| 98 | 98 | if (!mb_detect_encoding($item, 'utf-8', true)) { |
| 99 | 99 | $item = utf8_encode($item); |
| 100 | 100 | } |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | public static function slugify($str, $replace = array(), $delimiter = '-') |
| 21 | 21 | { |
| 22 | 22 | if (!empty($replace)) { |
| 23 | - $str = str_replace((array)$replace, ' ', $str); |
|
| 23 | + $str = str_replace((array) $replace, ' ', $str); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | $clean = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $str); |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | $errorMsg = $errorInfo[2]; |
| 90 | 90 | throw new \RuntimeException('SQLite Exception: ' . $errorMsg . ' in SQL: <br /><pre>' . $sql . '</pre>'); |
| 91 | 91 | } |
| 92 | - return (int)$result; |
|
| 92 | + return (int) $result; |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | /** |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | $resultObj = new SearchResult(); |
| 189 | 189 | $resultObj->documentPath = $result->documentPath; |
| 190 | 190 | $resultObj->matchingTokens = array($token); |
| 191 | - $resultObj->score = (float)$result->score; |
|
| 191 | + $resultObj->score = (float) $result->score; |
|
| 192 | 192 | $resultObj->setStorage($this->storage); |
| 193 | 193 | $finalResults[$result->documentPath] = $resultObj; |
| 194 | 194 | } |
@@ -19,7 +19,8 @@ discard block |
||
| 19 | 19 | <a href="<?= $request::$subfolders ?><?= $cmsPrefix ?>/search/update-index?returnUrl=<?= urlencode($request::$subfolders . $cmsPrefix . '/documents') ?>" |
| 20 | 20 | title="Update Index">Update Index</a> |
| 21 | 21 | </div> |
| 22 | - <?php else : ?> |
|
| 22 | + <?php else { |
|
| 23 | + : ?> |
|
| 23 | 24 | <div class="message valid"> |
| 24 | 25 | <i class="fa fa-check"></i> |
| 25 | 26 | Search index is in sync with documents. |
@@ -50,6 +51,7 @@ discard block |
||
| 50 | 51 | </tr> |
| 51 | 52 | <?php |
| 52 | 53 | $parentPath = substr($path, 0, strrpos($path, '/')); |
| 54 | +} |
|
| 53 | 55 | if ($path !== '/' && substr_count($path, '/') === 1) { |
| 54 | 56 | $parentPath = '/'; |
| 55 | 57 | } |
@@ -69,8 +71,11 @@ discard block |
||
| 69 | 71 | <tr> |
| 70 | 72 | <?php if ($document->type === 'folder') : ?> |
| 71 | 73 | <?php include(__DIR__ . '/documents/folder.php') ?> |
| 72 | - <?php else : ?> |
|
| 73 | - <?php include(__DIR__ . '/documents/document.php'); ?> |
|
| 74 | + <?php else { |
|
| 75 | + : ?> |
|
| 76 | + <?php include(__DIR__ . '/documents/document.php'); |
|
| 77 | +} |
|
| 78 | +?> |
|
| 74 | 79 | <?php endif ?> |
| 75 | 80 | </tr> |
| 76 | 81 | <?php endforeach ?> |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | if (preg_match('/\.(?:js|ico|txt|gif|jpg|jpeg|png|bmp|css|html|htm|php|pdf|exe|eot|svg|ttf|woff|ogg|mp3|xml|map|scss|json)$/', |
| 50 | 50 | $_SERVER['REQUEST_URI'])) { |
| 51 | 51 | if (file_exists($dir . $_SERVER["REQUEST_URI"])) { |
| 52 | - return true; // serve the requested resource as-is. |
|
| 52 | + return true; // serve the requested resource as-is. |
|
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | 55 | } |