Skip to content

Commit 7fca80b

Browse files
committed
Fix: Use strpos() instead of str_contains() for PHP 7.4 Comatibility
I was implementing this library in LearnDash Core and our CI checks for PHP Compatibility going back to PHP 7.4. This was the only issue that was flagged and it is a simple fix, so I figure it would be worthwhile swapping this out.
1 parent aa6249f commit 7fca80b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Actions/DisplayNoticesInAdmin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ private function passesScreenConditions(AdminNotice $notice): bool
141141
}
142142
} elseif (is_string($condition)) {
143143
// do a string comparison on the current url
144-
if (str_contains($currentUrl, $condition)) {
144+
if (strpos($currentUrl, $condition) !== false) {
145145
return true;
146146
}
147147
} else {

0 commit comments

Comments
 (0)