Skip to content

Commit b0ee11f

Browse files
committed
Improve escaping.
1 parent 3258839 commit b0ee11f

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,7 @@ __*Why "v3.0.0" instead of "v1.0.0?"*__ Prior to phpMussel v3, the "phpMussel Co
3737
### 3.2.1
3838

3939
[2022.11.22; Maikuolan]: Maintenance release.
40+
41+
### v3.3.0
42+
43+
[2023.12.01; Maikuolan]: Improved escaping.

src/CLI.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* License: GNU/GPLv2
99
* @see LICENSE.txt
1010
*
11-
* This file: CLI handler (last modified: 2023.09.26).
11+
* This file: CLI handler (last modified: 2023.12.01).
1212
*/
1313

1414
namespace phpMussel\CLI;
@@ -148,8 +148,8 @@ public function __construct(\phpMussel\Core\Loader &$Loader, \phpMussel\Core\Sca
148148
$Clean = $this->Scanner->normalise(substr($Clean, strlen($Command) + 1));
149149
$URL = ['AvoidMe' => '', 'ForThis' => ''];
150150
if (
151-
!preg_match_all('/(data|file|https?|ftps?|sftp|ss[hl])\:\/\/(www\d{0,3}\.)?([\da-z.-]{1,512})/i', $Clean, $URL['domain']) ||
152-
!preg_match_all('/(data|file|https?|ftps?|sftp|ss[hl])\:\/\/(www\d{0,3}\.)?([\!\#\$\&-;\=\?\@-\[\]_a-z~]{1,4000})/i', $Clean, $URL['url'])
151+
!preg_match_all('/(data|file|https?|ftps?|sftp|ss[hl]):\/\/(www\d{0,3}\.)?([\da-z.-]{1,512})/i', $Clean, $URL['domain']) ||
152+
!preg_match_all('/(data|file|https?|ftps?|sftp|ss[hl]):\/\/(www\d{0,3}\.)?([\!\#\$\&-;\=\?\@-\[\]_a-z~]{1,4000})/i', $Clean, $URL['url'])
153153
) {
154154
echo $this->Loader->L10N->getString('invalid_url') . "\n";
155155
continue;

0 commit comments

Comments
 (0)