Problem/Motivation

Using php 8.0/8.1, getting:

Deprecated function: stristr(): Passing null to parameter #1 ($haystack) of type string is deprecated in Drupal\amp\Service\AMPService->isDevPage() (line 173 of /var/www/html/web/modules/contrib/amp/src/Service/AMPService.php)

Proposed resolution

Check parameter #1 if exists.

CommentFileSizeAuthor
#6 amp_fix_deprecated_warnings.patch563 bytesigork96

Issue fork amp-3263406

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

szato created an issue. See original summary.

szato’s picture

Status: Active » Needs review
szato’s picture

apolitsin’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -

its work for me, thanks

igork96’s picture

StatusFileSize
new563 bytes
platinum1’s picture

I am curious why a patch like this does not get merged by the maintainers. Is AMP development dead?

uditrawat’s picture

#6 Patch working well with 8.x-3.x-dev

avpaderno’s picture

Title: PHP 8.0/8.1 compatibility: fix deprecated warnings » stristr(): Passing null to parameter #1 ($haystack) of type string is deprecated in Drupal\amp\Service\AMPService::isDevPage()
Issue tags: +PHP 8.1
avpaderno’s picture