Skip to content

Commit

Permalink
Merge pull request #1561 from oranges13/url-helper-php7-compatibility
Browse files Browse the repository at this point in the history
re #1560: Update preg_split in URLHelper
  • Loading branch information
khalwat authored Jan 9, 2025
2 parents e378b10 + bab7ba3 commit 84ba5f3
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 84ba5f3

Please sign in to comment.