@@ -52,7 +52,7 @@ |
||
52 | 52 | if ($dirInfo->isDir()) { |
53 | 53 | // The directory exists so delete it |
54 | 54 | if (!$utility::rrmdir($old_dir)) { |
55 | - $module->setErrors(\sprintf(\constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_DEL_PATH'), $old_dir)); |
|
55 | + $module->setErrors(\sprintf(\constant('CO_'.$moduleDirNameUpper.'_ERROR_BAD_DEL_PATH'), $old_dir)); |
|
56 | 56 | $success = false; |
57 | 57 | } |
58 | 58 | } |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | $cat_sql .= current($cats); |
34 | 34 | array_shift($cats); |
35 | 35 | foreach ($cats as $cat) { |
36 | - $cat_sql .= ',' . $cat; |
|
36 | + $cat_sql .= ','.$cat; |
|
37 | 37 | } |
38 | 38 | } |
39 | 39 | $cat_sql .= ')'; |
@@ -72,9 +72,9 @@ discard block |
||
72 | 72 | { |
73 | 73 | global $xoopsTpl, $xoTheme; |
74 | 74 | $myts = MyTextSanitizer::getInstance(); |
75 | - $content= $myts->undoHtmlSpecialChars($myts->displayTarea($content)); |
|
76 | - if(isset($xoTheme) && \is_object($xoTheme)) { |
|
77 | - $xoTheme->addMeta( 'meta', 'keywords', \strip_tags($content)); |
|
75 | + $content = $myts->undoHtmlSpecialChars($myts->displayTarea($content)); |
|
76 | + if (isset($xoTheme) && \is_object($xoTheme)) { |
|
77 | + $xoTheme->addMeta('meta', 'keywords', \strip_tags($content)); |
|
78 | 78 | } else { // Compatibility for old Xoops versions |
79 | 79 | $xoopsTpl->assign('xoops_meta_keywords', \strip_tags($content)); |
80 | 80 | } |
@@ -91,8 +91,8 @@ discard block |
||
91 | 91 | global $xoopsTpl, $xoTheme; |
92 | 92 | $myts = MyTextSanitizer::getInstance(); |
93 | 93 | $content = $myts->undoHtmlSpecialChars($myts->displayTarea($content)); |
94 | - if(isset($xoTheme) && \is_object($xoTheme)) { |
|
95 | - $xoTheme->addMeta( 'meta', 'description', \strip_tags($content)); |
|
94 | + if (isset($xoTheme) && \is_object($xoTheme)) { |
|
95 | + $xoTheme->addMeta('meta', 'description', \strip_tags($content)); |
|
96 | 96 | } else { // Compatibility for old Xoops versions |
97 | 97 | $xoopsTpl->assign('xoops_meta_description', \strip_tags($content)); |
98 | 98 | } |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | if (0 != $lenght_id) { |
118 | 118 | $id = $array['content_id']; |
119 | 119 | while (\strlen($id) < $lenght_id) { |
120 | - $id = '0' . $id; |
|
120 | + $id = '0'.$id; |
|
121 | 121 | } |
122 | 122 | } else { |
123 | 123 | $id = $array['content_id']; |
@@ -132,23 +132,23 @@ discard block |
||
132 | 132 | switch ($rewrite_url) { |
133 | 133 | |
134 | 134 | case 'none': |
135 | - if($topic_name) { |
|
136 | - $topic_name = 'topic=' . $topic_name . '&'; |
|
135 | + if ($topic_name) { |
|
136 | + $topic_name = 'topic='.$topic_name.'&'; |
|
137 | 137 | } |
138 | 138 | $rewrite_base = '/modules/'; |
139 | - $page = 'page=' . $array['content_alias']; |
|
140 | - return XOOPS_URL . $rewrite_base . $module . '/' . $type . '.php?' . $topic_name . 'id=' . $id . '&' . $page . $comment; |
|
139 | + $page = 'page='.$array['content_alias']; |
|
140 | + return XOOPS_URL.$rewrite_base.$module.'/'.$type.'.php?'.$topic_name.'id='.$id.'&'.$page.$comment; |
|
141 | 141 | break; |
142 | 142 | |
143 | 143 | case 'rewrite': |
144 | - if($topic_name) { |
|
144 | + if ($topic_name) { |
|
145 | 145 | $topic_name .= '/'; |
146 | 146 | } |
147 | 147 | $rewrite_base = xoops_getModuleOption('rewrite_mode', $module); |
148 | 148 | $rewrite_ext = xoops_getModuleOption('rewrite_ext', $module); |
149 | 149 | $module_name = ''; |
150 | - if(xoops_getModuleOption('rewrite_name', $module)) { |
|
151 | - $module_name = xoops_getModuleOption('rewrite_name', $module) . '/'; |
|
150 | + if (xoops_getModuleOption('rewrite_name', $module)) { |
|
151 | + $module_name = xoops_getModuleOption('rewrite_name', $module).'/'; |
|
152 | 152 | } |
153 | 153 | $page = $array['content_alias']; |
154 | 154 | $type .= '/'; |
@@ -157,21 +157,21 @@ discard block |
||
157 | 157 | $type = ''; |
158 | 158 | } |
159 | 159 | if ('comment-edit/' === $type || 'comment-reply/' === $type || 'comment-delete/' === $type) { |
160 | - return XOOPS_URL . $rewrite_base . $module_name . $type . $id . '/'; |
|
160 | + return XOOPS_URL.$rewrite_base.$module_name.$type.$id.'/'; |
|
161 | 161 | } |
162 | 162 | |
163 | - return XOOPS_URL . $rewrite_base . $module_name . $type . $topic_name . $id . $page . $rewrite_ext; |
|
163 | + return XOOPS_URL.$rewrite_base.$module_name.$type.$topic_name.$id.$page.$rewrite_ext; |
|
164 | 164 | break; |
165 | 165 | |
166 | 166 | case 'short': |
167 | - if($topic_name) { |
|
167 | + if ($topic_name) { |
|
168 | 168 | $topic_name .= '/'; |
169 | 169 | } |
170 | 170 | $rewrite_base = xoops_getModuleOption('rewrite_mode', $module); |
171 | 171 | $rewrite_ext = xoops_getModuleOption('rewrite_ext', $module); |
172 | 172 | $module_name = ''; |
173 | - if(xoops_getModuleOption('rewrite_name', $module)) { |
|
174 | - $module_name = xoops_getModuleOption('rewrite_name', $module) . '/'; |
|
173 | + if (xoops_getModuleOption('rewrite_name', $module)) { |
|
174 | + $module_name = xoops_getModuleOption('rewrite_name', $module).'/'; |
|
175 | 175 | } |
176 | 176 | $page = $array['content_alias']; |
177 | 177 | $type .= '/'; |
@@ -179,10 +179,10 @@ discard block |
||
179 | 179 | $type = ''; |
180 | 180 | } |
181 | 181 | if ('comment-edit/' === $type || 'comment-reply/' === $type || 'comment-delete/' === $type) { |
182 | - return XOOPS_URL . $rewrite_base . $module_name . $type . $id . '/'; |
|
182 | + return XOOPS_URL.$rewrite_base.$module_name.$type.$id.'/'; |
|
183 | 183 | } |
184 | 184 | |
185 | - return XOOPS_URL . $rewrite_base . $module_name . $type . $topic_name . $page . $rewrite_ext; |
|
185 | + return XOOPS_URL.$rewrite_base.$module_name.$type.$topic_name.$page.$rewrite_ext; |
|
186 | 186 | break; |
187 | 187 | } |
188 | 188 | return null; |
@@ -207,6 +207,6 @@ discard block |
||
207 | 207 | $url .= htmlentities($url, ENT_COMPAT, 'utf-8'); |
208 | 208 | $url .= \preg_replace('`&([a-z])(acute|uml|circ|grave|ring|cedil|slash|tilde|caron|lig);`i', "\1", $url); |
209 | 209 | $url .= \preg_replace(array($regular_expression, '`[-]+`'), '-', $url); |
210 | - $url = ($url == '') ? $type : strtolower( rim($url, '-')); |
|
210 | + $url = ($url == '') ? $type : strtolower(rim($url, '-')); |
|
211 | 211 | return $url; |
212 | 212 | } |
213 | 213 | \ No newline at end of file |
@@ -27,7 +27,7 @@ |
||
27 | 27 | */ |
28 | 28 | public function doHandleRequest(RequestInterface $request, callable $next, callable $first) |
29 | 29 | { |
30 | - return $next($request)->then(function (ResponseInterface $response) use ($request) { |
|
30 | + return $next($request)->then(function(ResponseInterface $response) use ($request) { |
|
31 | 31 | if ($response->getStatusCode() < 400 || $response->getStatusCode() > 600) { |
32 | 32 | return $response; |
33 | 33 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | if (!$this->isValid($value)) { |
57 | 57 | /** @psalm-suppress InvalidCast */ |
58 | - throw new \UnexpectedValueException("Value '$value' is not part of the enum " . static::class); |
|
58 | + throw new \UnexpectedValueException("Value '$value' is not part of the enum ".static::class); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | /** @psalm-var T */ |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | */ |
91 | 91 | public function __toString() |
92 | 92 | { |
93 | - return (string)$this->value; |
|
93 | + return (string) $this->value; |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | /** |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | return new static($array[$name]); |
222 | 222 | } |
223 | 223 | |
224 | - throw new \BadMethodCallException("No static method or enum constant '$name' in class " . static::class); |
|
224 | + throw new \BadMethodCallException("No static method or enum constant '$name' in class ".static::class); |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | /** |
@@ -100,7 +100,7 @@ |
||
100 | 100 | */ |
101 | 101 | public function isSeekable(): bool |
102 | 102 | { |
103 | - return (bool)$this->getMetadata('seekable'); |
|
103 | + return (bool) $this->getMetadata('seekable'); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |
@@ -100,9 +100,9 @@ |
||
100 | 100 | public function getLowFF(bool $force = false): float |
101 | 101 | { |
102 | 102 | if ($force || $this->isOver32()) { |
103 | - return (float)0xFFFFFFFF; |
|
103 | + return (float) 0xFFFFFFFF; |
|
104 | 104 | } |
105 | - return (float)$this->getLow32(); |
|
105 | + return (float) $this->getLow32(); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | /** |
@@ -390,16 +390,16 @@ discard block |
||
390 | 390 | $cdr_offset = $this->ofs; |
391 | 391 | |
392 | 392 | $fields = [ |
393 | - ['V', static::ZIP64_CDR_EOF_SIGNATURE], // ZIP64 end of central file header signature |
|
394 | - ['P', 44], // Length of data below this header (length of block - 12) = 44 |
|
395 | - ['v', static::ZIP_VERSION_MADE_BY], // Made by version |
|
396 | - ['v', Version::ZIP64], // Extract by version |
|
397 | - ['V', 0x00], // disk number |
|
398 | - ['V', 0x00], // no of disks |
|
399 | - ['P', $num_files], // no of entries on disk |
|
400 | - ['P', $num_files], // no of entries in cdr |
|
401 | - ['P', $cdr_length], // CDR size |
|
402 | - ['P', $cdr_offset], // CDR offset |
|
393 | + ['V', static::ZIP64_CDR_EOF_SIGNATURE], // ZIP64 end of central file header signature |
|
394 | + ['P', 44], // Length of data below this header (length of block - 12) = 44 |
|
395 | + ['v', static::ZIP_VERSION_MADE_BY], // Made by version |
|
396 | + ['v', Version::ZIP64], // Extract by version |
|
397 | + ['V', 0x00], // disk number |
|
398 | + ['V', 0x00], // no of disks |
|
399 | + ['P', $num_files], // no of entries on disk |
|
400 | + ['P', $num_files], // no of entries in cdr |
|
401 | + ['P', $cdr_length], // CDR size |
|
402 | + ['P', $cdr_offset], // CDR offset |
|
403 | 403 | ]; |
404 | 404 | |
405 | 405 | $ret = static::packFields($fields); |
@@ -517,9 +517,9 @@ discard block |
||
517 | 517 | |
518 | 518 | $fields = [ |
519 | 519 | ['V', static::ZIP64_CDR_LOCATOR_SIGNATURE], // ZIP64 end of central file header signature |
520 | - ['V', 0x00], // Disc number containing CDR64EOF |
|
521 | - ['P', $cdr_offset], // CDR offset |
|
522 | - ['V', 1], // Total number of disks |
|
520 | + ['V', 0x00], // Disc number containing CDR64EOF |
|
521 | + ['P', $cdr_offset], // CDR offset |
|
522 | + ['V', 1], // Total number of disks |
|
523 | 523 | ]; |
524 | 524 | |
525 | 525 | $ret = static::packFields($fields); |
@@ -541,17 +541,17 @@ discard block |
||
541 | 541 | $comment = $this->opt->getComment(); |
542 | 542 | |
543 | 543 | $fields = [ |
544 | - ['V', static::CDR_EOF_SIGNATURE], // end of central file header signature |
|
545 | - ['v', 0x00], // disk number |
|
546 | - ['v', 0x00], // no of disks |
|
547 | - ['v', min($num_files, 0xFFFF)], // no of entries on disk |
|
548 | - ['v', min($num_files, 0xFFFF)], // no of entries in cdr |
|
549 | - ['V', $cdr_length->getLowFF()], // CDR size |
|
550 | - ['V', $cdr_offset->getLowFF()], // CDR offset |
|
551 | - ['v', \strlen($comment)], // Zip Comment size |
|
544 | + ['V', static::CDR_EOF_SIGNATURE], // end of central file header signature |
|
545 | + ['v', 0x00], // disk number |
|
546 | + ['v', 0x00], // no of disks |
|
547 | + ['v', min($num_files, 0xFFFF)], // no of entries on disk |
|
548 | + ['v', min($num_files, 0xFFFF)], // no of entries in cdr |
|
549 | + ['V', $cdr_length->getLowFF()], // CDR size |
|
550 | + ['V', $cdr_offset->getLowFF()], // CDR offset |
|
551 | + ['v', \strlen($comment)], // Zip Comment size |
|
552 | 552 | ]; |
553 | 553 | |
554 | - $ret = static::packFields($fields) . $comment; |
|
554 | + $ret = static::packFields($fields).$comment; |
|
555 | 555 | $this->send($ret); |
556 | 556 | } |
557 | 557 |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | if (!mb_check_encoding($name, 'UTF-8') || |
164 | 164 | !mb_check_encoding($comment, 'UTF-8')) { |
165 | 165 | throw new EncodingException( |
166 | - 'File name and comment should use UTF-8 ' . |
|
166 | + 'File name and comment should use UTF-8 '. |
|
167 | 167 | 'if one of them does not fit into ASCII range.' |
168 | 168 | ); |
169 | 169 | } |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | $this->version = Version::DEFLATE(); |
175 | 175 | } |
176 | 176 | |
177 | - $force = (boolean)($this->bits & self::BIT_ZERO_HEADER) && |
|
177 | + $force = (boolean) ($this->bits & self::BIT_ZERO_HEADER) && |
|
178 | 178 | $this->zip->opt->isEnableZip64(); |
179 | 179 | |
180 | 180 | $footer = $this->buildZip64ExtraBlock($force); |
@@ -188,22 +188,22 @@ discard block |
||
188 | 188 | |
189 | 189 | $fields = [ |
190 | 190 | ['V', ZipStream::FILE_HEADER_SIGNATURE], |
191 | - ['v', $this->version->getValue()], // Version needed to Extract |
|
192 | - ['v', $this->bits], // General purpose bit flags - data descriptor flag set |
|
193 | - ['v', $this->method->getValue()], // Compression method |
|
194 | - ['V', $time], // Timestamp (DOS Format) |
|
195 | - ['V', $this->crc], // CRC32 of data (0 -> moved to data descriptor footer) |
|
196 | - ['V', $this->zlen->getLowFF($force)], // Length of compressed data (forced to 0xFFFFFFFF for zero header) |
|
197 | - ['V', $this->len->getLowFF($force)], // Length of original data (forced to 0xFFFFFFFF for zero header) |
|
198 | - ['v', $nameLength], // Length of filename |
|
199 | - ['v', \strlen($footer)], // Extra data (see above) |
|
191 | + ['v', $this->version->getValue()], // Version needed to Extract |
|
192 | + ['v', $this->bits], // General purpose bit flags - data descriptor flag set |
|
193 | + ['v', $this->method->getValue()], // Compression method |
|
194 | + ['V', $time], // Timestamp (DOS Format) |
|
195 | + ['V', $this->crc], // CRC32 of data (0 -> moved to data descriptor footer) |
|
196 | + ['V', $this->zlen->getLowFF($force)], // Length of compressed data (forced to 0xFFFFFFFF for zero header) |
|
197 | + ['V', $this->len->getLowFF($force)], // Length of original data (forced to 0xFFFFFFFF for zero header) |
|
198 | + ['v', $nameLength], // Length of filename |
|
199 | + ['v', \strlen($footer)], // Extra data (see above) |
|
200 | 200 | ]; |
201 | 201 | |
202 | 202 | // pack fields and calculate "total" length |
203 | 203 | $header = ZipStream::packFields($fields); |
204 | 204 | |
205 | 205 | // print header and filename |
206 | - $data = $header . $name . $footer; |
|
206 | + $data = $header.$name.$footer; |
|
207 | 207 | $this->zip->send($data); |
208 | 208 | |
209 | 209 | // save header length |
@@ -267,15 +267,15 @@ discard block |
||
267 | 267 | |
268 | 268 | $fields = []; |
269 | 269 | if ($this->len->isOver32($force)) { |
270 | - $fields[] = ['P', $this->len]; // Length of original data |
|
270 | + $fields[] = ['P', $this->len]; // Length of original data |
|
271 | 271 | } |
272 | 272 | |
273 | 273 | if ($this->len->isOver32($force)) { |
274 | - $fields[] = ['P', $this->zlen]; // Length of compressed data |
|
274 | + $fields[] = ['P', $this->zlen]; // Length of compressed data |
|
275 | 275 | } |
276 | 276 | |
277 | 277 | if ($this->ofs->isOver32()) { |
278 | - $fields[] = ['P', $this->ofs]; // Offset of local header record |
|
278 | + $fields[] = ['P', $this->ofs]; // Offset of local header record |
|
279 | 279 | } |
280 | 280 | |
281 | 281 | if (!empty($fields)) { |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | |
286 | 286 | \array_unshift( |
287 | 287 | $fields, |
288 | - ['v', 0x0001], // 64 bit extension |
|
288 | + ['v', 0x0001], // 64 bit extension |
|
289 | 289 | ['v', \count($fields) * 8] // Length of data block |
290 | 290 | ); |
291 | 291 | $this->version = Version::ZIP64(); |
@@ -311,9 +311,9 @@ discard block |
||
311 | 311 | } |
312 | 312 | $fields = [ |
313 | 313 | ['V', ZipStream::DATA_DESCRIPTOR_SIGNATURE], |
314 | - ['V', $this->crc], // CRC32 |
|
315 | - [$sizeFormat, $this->zlen], // Length of compressed data |
|
316 | - [$sizeFormat, $this->len], // Length of original data |
|
314 | + ['V', $this->crc], // CRC32 |
|
315 | + [$sizeFormat, $this->zlen], // Length of compressed data |
|
316 | + [$sizeFormat, $this->len], // Length of original data |
|
317 | 317 | ]; |
318 | 318 | |
319 | 319 | $footer = ZipStream::packFields($fields); |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | $data = $stream->read(self::CHUNKED_READ_BLOCK_SIZE); |
355 | 355 | $total += \strlen($data); |
356 | 356 | if ($size > 0 && $total > $size) { |
357 | - $data = \substr($data, 0 , \strlen($data)-($total - $size)); |
|
357 | + $data = \substr($data, 0, \strlen($data) - ($total - $size)); |
|
358 | 358 | } |
359 | 359 | $this->deflateData($stream, $data, $options); |
360 | 360 | if ($options & self::SEND) { |
@@ -443,28 +443,28 @@ discard block |
||
443 | 443 | $footer = $this->buildZip64ExtraBlock(); |
444 | 444 | |
445 | 445 | $fields = [ |
446 | - ['V', ZipStream::CDR_FILE_SIGNATURE], // Central file header signature |
|
447 | - ['v', ZipStream::ZIP_VERSION_MADE_BY], // Made by version |
|
448 | - ['v', $this->version->getValue()], // Extract by version |
|
449 | - ['v', $this->bits], // General purpose bit flags - data descriptor flag set |
|
450 | - ['v', $this->method->getValue()], // Compression method |
|
451 | - ['V', $time], // Timestamp (DOS Format) |
|
452 | - ['V', $this->crc], // CRC32 |
|
453 | - ['V', $this->zlen->getLowFF()], // Compressed Data Length |
|
454 | - ['V', $this->len->getLowFF()], // Original Data Length |
|
455 | - ['v', \strlen($name)], // Length of filename |
|
456 | - ['v', \strlen($footer)], // Extra data len (see above) |
|
457 | - ['v', \strlen($comment)], // Length of comment |
|
458 | - ['v', 0], // Disk number |
|
459 | - ['v', 0], // Internal File Attributes |
|
460 | - ['V', 32], // External File Attributes |
|
446 | + ['V', ZipStream::CDR_FILE_SIGNATURE], // Central file header signature |
|
447 | + ['v', ZipStream::ZIP_VERSION_MADE_BY], // Made by version |
|
448 | + ['v', $this->version->getValue()], // Extract by version |
|
449 | + ['v', $this->bits], // General purpose bit flags - data descriptor flag set |
|
450 | + ['v', $this->method->getValue()], // Compression method |
|
451 | + ['V', $time], // Timestamp (DOS Format) |
|
452 | + ['V', $this->crc], // CRC32 |
|
453 | + ['V', $this->zlen->getLowFF()], // Compressed Data Length |
|
454 | + ['V', $this->len->getLowFF()], // Original Data Length |
|
455 | + ['v', \strlen($name)], // Length of filename |
|
456 | + ['v', \strlen($footer)], // Extra data len (see above) |
|
457 | + ['v', \strlen($comment)], // Length of comment |
|
458 | + ['v', 0], // Disk number |
|
459 | + ['v', 0], // Internal File Attributes |
|
460 | + ['V', 32], // External File Attributes |
|
461 | 461 | ['V', $this->ofs->getLowFF()] // Relative offset of local header |
462 | 462 | ]; |
463 | 463 | |
464 | 464 | // pack fields, then append name and comment |
465 | 465 | $header = ZipStream::packFields($fields); |
466 | 466 | |
467 | - return $header . $name . $footer . $comment; |
|
467 | + return $header.$name.$footer.$comment; |
|
468 | 468 | } |
469 | 469 | |
470 | 470 | /** |
@@ -21,7 +21,7 @@ |
||
21 | 21 | */ |
22 | 22 | public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise |
23 | 23 | { |
24 | - return $next($request)->then(function (ResponseInterface $response) { |
|
24 | + return $next($request)->then(function(ResponseInterface $response) { |
|
25 | 25 | if ($response->getBody()->isSeekable()) { |
26 | 26 | return $response; |
27 | 27 | } |