Problem/Motivation

The preg_split() using third argument as NULL but it should be integer (0 or -1)

Steps to reproduce

use core on 8.1 (visit admin/reports/dblog) as you'll get following in watchdog

Deprecated function: preg_split(): Passing null to parameter #3 ($limit) of type int is deprecated in Drupal\big_pipe\Render\BigPipe::splitHtmlOnPlaceholders() (line 777 of /var/www/html/web/core/modules/big_pipe/src/Render/BigPipe.php)

#0 /var/www/html/web/core/includes/bootstrap.inc(346): _drupal_error_handler_real()
#1 [internal function]: _drupal_error_handler()
#2 /var/www/html/web/core/modules/big_pipe/src/Render/BigPipe.php(777): preg_split()
#3 /var/www/html/web/core/modules/big_pipe/src/Render/BigPipe.php(393): Drupal\big_pipe\Render\BigPipe::splitHtmlOnPlaceholders()
#4 /var/www/html/web/core/modules/big_pipe/src/Render/BigPipe.php(336): Drupal\big_pipe\Render\BigPipe->sendNoJsPlaceholders()
#5 /var/www/html/web/core/modules/big_pipe/src/Render/BigPipe.php(304): Drupal\big_pipe\Render\BigPipe->sendPreBody()
#6 /var/www/html/web/core/modules/big_pipe/src/Render/BigPipeResponse.php(112): Drupal\big_pipe\Render\BigPipe->sendContent()
#7 /var/www/html/web/vendor/symfony/http-foundation/Response.php(381): Drupal\big_pipe\Render\BigPipeResponse->sendContent()
#8 /var/www/html/web/index.php(20): Symfony\Component\HttpFoundation\Response->send()
#9 {main}

Proposed resolution

replace with 0, ref https://www.php.net/manual/en/function.preg-split.php

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#2 3238941-2.patch757 bytesandypost

Comments

andypost created an issue. See original summary.

andypost’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new757 bytes

the fix

andypost’s picture

Issue summary: View changes
daffie’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.
The third parameter should be an integer. The default value is -1, only 0 does the same.

  • catch committed c6c5559 on 9.3.x
    Issue #3238941 by andypost, daffie: \Drupal\big_pipe\Render\BigPipe::...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed c6c5559 and pushed to 9.3.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.