@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $validator->add('url', ['url' => ['rule' => 'url']]); |
64 | 64 | $errors = $validator->errors(['url' => $url]); |
65 | 65 | if (empty($errors)) { |
66 | - $url = 'http://' . $url; |
|
66 | + $url = 'http://'.$url; |
|
67 | 67 | } |
68 | 68 | } |
69 | 69 | |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | if (!empty($url) && preg_match('/\<img\s*?src=/', $text) !== 1) { |
80 | 80 | $host = DomainParser::domainAndTld($url); |
81 | 81 | if ($host !== false && $host !== env('SERVER_NAME')) { |
82 | - $out .= ' <span class=\'richtext-linkInfo\'>[' . $host . ']</span>'; |
|
82 | + $out .= ' <span class=\'richtext-linkInfo\'>['.$host.']</span>'; |
|
83 | 83 | } |
84 | 84 | } |
85 | 85 | } |
@@ -112,10 +112,10 @@ discard block |
||
112 | 112 | } |
113 | 113 | |
114 | 114 | $_placeholder = ' … '; |
115 | - $leftMargin = (int)floor($_textWordMaxLength / 2); |
|
116 | - $rightMargin = (int)(-1 * ($_textWordMaxLength - $leftMargin - mb_strlen($_placeholder))); |
|
115 | + $leftMargin = (int) floor($_textWordMaxLength / 2); |
|
116 | + $rightMargin = (int) (-1 * ($_textWordMaxLength - $leftMargin - mb_strlen($_placeholder))); |
|
117 | 117 | |
118 | - $string = mb_substr($string, 0, $leftMargin) . $_placeholder . |
|
118 | + $string = mb_substr($string, 0, $leftMargin).$_placeholder. |
|
119 | 119 | mb_substr($string, $rightMargin); |
120 | 120 | |
121 | 121 | return $string; |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | */ |
131 | 131 | protected function _decorateTarget($string) |
132 | 132 | { |
133 | - $decorator = function ($matches) { |
|
133 | + $decorator = function($matches) { |
|
134 | 134 | $out = ''; |
135 | 135 | $url = $matches[1]; |
136 | 136 | |
@@ -141,12 +141,12 @@ discard block |
||
141 | 141 | $parsedUrl = parse_url($url); |
142 | 142 | |
143 | 143 | if (isset($parsedUrl['host'])) { |
144 | - if ($parsedUrl['host'] !== env('SERVER_NAME') && $parsedUrl['host'] !== "www." . env('SERVER_NAME')) { |
|
144 | + if ($parsedUrl['host'] !== env('SERVER_NAME') && $parsedUrl['host'] !== "www.".env('SERVER_NAME')) { |
|
145 | 145 | $out = " rel='external' target='_blank'"; |
146 | 146 | } |
147 | 147 | } |
148 | 148 | |
149 | - return $matches[0] . $out; |
|
149 | + return $matches[0].$out; |
|
150 | 150 | }; |
151 | 151 | |
152 | 152 | return preg_replace_callback( |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | } |
122 | 122 | // add newline to wrapped lines |
123 | 123 | if (mb_strlen($line) > 60) { |
124 | - $out .= $line . "\n"; |
|
124 | + $out .= $line."\n"; |
|
125 | 125 | $line = ''; |
126 | 126 | } |
127 | 127 | } |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | } |
130 | 130 | $out = preg_replace( |
131 | 131 | "/^/m", |
132 | - $quoteSymbol . " ", |
|
132 | + $quoteSymbol." ", |
|
133 | 133 | $out |
134 | 134 | ); |
135 | 135 |
@@ -13,10 +13,10 @@ |
||
13 | 13 | $quoteSymbolSanitized = h($this->_sOptions->get('quote_symbol')); |
14 | 14 | $string = preg_replace( |
15 | 15 | // Begin of the text or a new line in the text, maybe one space afterwards |
16 | - '/(^|\n\r\s?)' . |
|
17 | - $quoteSymbolSanitized . |
|
16 | + '/(^|\n\r\s?)'. |
|
17 | + $quoteSymbolSanitized. |
|
18 | 18 | '\s(.*)(?!\<br)/m', |
19 | - "\\1<span class=\"richtext-citation\">" . $quoteSymbolSanitized . " \\2</span>", |
|
19 | + "\\1<span class=\"richtext-citation\">".$quoteSymbolSanitized." \\2</span>", |
|
20 | 20 | $string |
21 | 21 | ); |
22 | 22 |
@@ -69,11 +69,11 @@ discard block |
||
69 | 69 | } |
70 | 70 | } |
71 | 71 | krsort($names); |
72 | - $baseUrl = $this->_sOptions->get('webroot') . $this->_sOptions->get('atBaseUrl'); |
|
72 | + $baseUrl = $this->_sOptions->get('webroot').$this->_sOptions->get('atBaseUrl'); |
|
73 | 73 | foreach ($names as $name => $v) { |
74 | 74 | $title = urlencode($name); |
75 | 75 | $link = $this->_url( |
76 | - $baseUrl . $title, |
|
76 | + $baseUrl.$title, |
|
77 | 77 | "@$name", |
78 | 78 | false |
79 | 79 | ); |
@@ -92,11 +92,11 @@ discard block |
||
92 | 92 | */ |
93 | 93 | protected function _autolink($string) |
94 | 94 | { |
95 | - $replace = function ($matches) { |
|
95 | + $replace = function($matches) { |
|
96 | 96 | // exclude punctuation at end of sentence from URLs |
97 | 97 | $ignoredEndChars = implode('|', [',', '\?', ',', '\.', '\)', '!']); |
98 | 98 | preg_match( |
99 | - '/(?P<element>.*?)(?P<suffix>' . $ignoredEndChars . ')?$/', |
|
99 | + '/(?P<element>.*?)(?P<suffix>'.$ignoredEndChars.')?$/', |
|
100 | 100 | $matches['element'], |
101 | 101 | $m |
102 | 102 | ); |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | $matches = $m + $matches; |
105 | 105 | |
106 | 106 | if (strpos($matches['element'], '://') === false) { |
107 | - $matches['element'] = 'http://' . $matches['element']; |
|
107 | + $matches['element'] = 'http://'.$matches['element']; |
|
108 | 108 | } |
109 | 109 | $matches += [ |
110 | 110 | 'prefix' => '', |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | true |
119 | 119 | ); |
120 | 120 | |
121 | - return $matches['prefix'] . $url . $matches['suffix']; |
|
121 | + return $matches['prefix'].$url.$matches['suffix']; |
|
122 | 122 | }; |
123 | 123 | |
124 | 124 | //# autolink http://urls |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | //# autolink email |
139 | 139 | $string = preg_replace_callback( |
140 | 140 | "#(?<=^|[\n ])(?P<content>([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+))#i", |
141 | - function ($matches) { |
|
141 | + function($matches) { |
|
142 | 142 | return $this->_email($matches['content']); |
143 | 143 | }, |
144 | 144 | $string |
@@ -156,13 +156,13 @@ discard block |
||
156 | 156 | */ |
157 | 157 | protected function _hashLink($string) |
158 | 158 | { |
159 | - $baseUrl = $this->_sOptions->get('webroot') . $this->_sOptions->get('hashBaseUrl'); |
|
159 | + $baseUrl = $this->_sOptions->get('webroot').$this->_sOptions->get('hashBaseUrl'); |
|
160 | 160 | $string = preg_replace_callback( |
161 | 161 | '/(?<=\s|^|])(?<tag>#)(?<element>\d+)(?!\w)/', |
162 | - function ($m) use ($baseUrl) { |
|
162 | + function($m) use ($baseUrl) { |
|
163 | 163 | $hash = $m['element']; |
164 | 164 | |
165 | - return $this->_url($baseUrl . $hash, '#' . $hash); |
|
165 | + return $this->_url($baseUrl.$hash, '#'.$hash); |
|
166 | 166 | }, |
167 | 167 | $string |
168 | 168 | ); |
@@ -24,7 +24,7 @@ |
||
24 | 24 | // load config from app/Config/geshi.php |
25 | 25 | $this->Geshi->features = false; |
26 | 26 | |
27 | - $string = '<div class="geshi-wrapper"><pre lang="' . $type . '">' . $content . '</pre></div>'; |
|
27 | + $string = '<div class="geshi-wrapper"><pre lang="'.$type.'">'.$content.'</pre></div>'; |
|
28 | 28 | |
29 | 29 | $string = $this->Geshi->highlight($string); |
30 | 30 |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | $out = "<audio src='$content' controls='controls'>"; |
29 | 29 | $out .= Message::format( |
30 | 30 | __( |
31 | - 'Your browser does not support HTML5 audio. Please updgrade to a modern ' . |
|
31 | + 'Your browser does not support HTML5 audio. Please updgrade to a modern '. |
|
32 | 32 | 'browser. In order to watch this stream you need an HTML5 capable browser.', |
33 | 33 | true |
34 | 34 | ) |
@@ -48,14 +48,14 @@ discard block |
||
48 | 48 | protected function _video($content) |
49 | 49 | { |
50 | 50 | // fix audio files mistakenly wrapped into an [video] tag |
51 | - if (preg_match('/(' . implode('|', self::$_html5AudioExtensions) . ')$/i', $content) === 1) { |
|
51 | + if (preg_match('/('.implode('|', self::$_html5AudioExtensions).')$/i', $content) === 1) { |
|
52 | 52 | return $this->_audio($content); |
53 | 53 | } |
54 | 54 | |
55 | 55 | $out = "<video src='$content' controls='controls' x-webkit-airplay='allow'>"; |
56 | 56 | $out .= Message::format( |
57 | 57 | __( |
58 | - 'Your browser does not support HTML5 video. Please updgrade to a modern ' . |
|
58 | + 'Your browser does not support HTML5 video. Please updgrade to a modern '. |
|
59 | 59 | 'browser. In order to watch this stream you need an HTML5 capable browser.', |
60 | 60 | true |
61 | 61 | ) |
@@ -29,11 +29,11 @@ |
||
29 | 29 | if (empty($title) === false) { |
30 | 30 | $hasTitle = 1; |
31 | 31 | } |
32 | - $rand = "moh_" . md5(mt_rand(1, 10000) . $addr); |
|
32 | + $rand = "moh_".md5(mt_rand(1, 10000).$addr); |
|
33 | 33 | list($ttl, $dom) = explode('@', $addr); |
34 | 34 | |
35 | 35 | // missing style='unicode-bidi:bidi-override;direction:rtl;' |
36 | - $mailto = '<a id="' . $rand . '" href="#" data-ttl="' . $ttl . '" data-dom="' . $dom . '">' . $title . '</a>'; |
|
36 | + $mailto = '<a id="'.$rand.'" href="#" data-ttl="'.$ttl.'" data-dom="'.$dom.'">'.$title.'</a>'; |
|
37 | 37 | $mailto .= '<noscript><p>[You need to have Javascript enabled to see this mail address.]</p></noscript>'; |
38 | 38 | $mailto .= $this->Html->scriptBlock( |
39 | 39 | "$(function(){ |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Saito - The Threaded Web Forum |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | */ |
37 | 37 | public function html(): string |
38 | 38 | { |
39 | - $memory = 'Peak memory usage: ' . $this->Number->toReadableSize(memory_get_peak_usage()); |
|
39 | + $memory = 'Peak memory usage: '.$this->Number->toReadableSize(memory_get_peak_usage()); |
|
40 | 40 | $html = $this->Html->para('', $memory); |
41 | 41 | |
42 | 42 | $html .= $this->Html->tag( |
@@ -117,6 +117,6 @@ discard block |
||
117 | 117 | */ |
118 | 118 | private function getResult() |
119 | 119 | { |
120 | - return "<pre>" . Stopwatch::getString() . "</pre>"; |
|
120 | + return "<pre>".Stopwatch::getString()."</pre>"; |
|
121 | 121 | } |
122 | 122 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types = 1); |
|
3 | +declare(strict_types=1); |
|
4 | 4 | |
5 | 5 | /** |
6 | 6 | * Saito - The Threaded Web Forum |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | */ |
51 | 51 | public function start() |
52 | 52 | { |
53 | - $token = new File(CONFIG . 'updater'); |
|
53 | + $token = new File(CONFIG.'updater'); |
|
54 | 54 | |
55 | 55 | if ($token->exists()) { |
56 | 56 | $this->renderFailure(__d('installer', 'update.failure.explanation'), 1529737182); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | (new DbVersion($this->Settings))->set($this->saitoVersion); |
107 | 107 | $this->logCurrentState('Post upgrade state.'); |
108 | 108 | } catch (\Throwable $e) { |
109 | - $this->logCurrentState('Migration failed: ' . $e->getMessage()); |
|
109 | + $this->logCurrentState('Migration failed: '.$e->getMessage()); |
|
110 | 110 | |
111 | 111 | return $this->redirect('/'); |
112 | 112 | } |
@@ -15,9 +15,6 @@ |
||
15 | 15 | use Cake\Core\Configure; |
16 | 16 | use Cake\Event\Event; |
17 | 17 | use Cake\Filesystem\File; |
18 | -use Cake\I18n\I18n; |
|
19 | -use Cake\ORM\Table; |
|
20 | -use Cake\ORM\TableRegistry; |
|
21 | 18 | use Installer\Form\UpdaterStartForm; |
22 | 19 | use Installer\Lib\DbVersion; |
23 | 20 | use Psr\Log\LogLevel; |