Skip to content

Commit

Permalink
Update UrlHelper.php
Browse files Browse the repository at this point in the history
Version 3.9.10 contained php8 only code, so this will fix it for everyone still using PHP 7 - fixes #1560
  • Loading branch information
oranges13 authored Jan 9, 2025
1 parent f67e426 commit bab7ba3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/helpers/UrlHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public static function getSiteUrlOverrideSetting(?int $siteId = null): string
*/
public static function encodeUrl(string $url): string
{
$parts = preg_split('/([:\/?#\[\]@!$&\'()*+,;=%])/', $url, flags: PREG_SPLIT_DELIM_CAPTURE);
$parts = preg_split('/([:\/?#\[\]@!$&\'()*+,;=%])/', $url, null, PREG_SPLIT_DELIM_CAPTURE);

Check failure on line 290 in src/helpers/UrlHelper.php

View workflow job for this annotation

GitHub Actions / PHPStan

Parameter #3 $limit of function preg_split expects int, null given.
$url = '';
foreach ($parts as $i => $part) {
if ($i % 2 === 0) {
Expand Down

0 comments on commit bab7ba3

Please sign in to comment.