Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecation in preg_match when $path is NULL #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chrisgaraffa
Copy link

By default CRM_Utils_Array will return NULL if the key doesn't exist. Passing NULL to parameter 2 of preg_match is now deprecated behavior:

Got error 'PHP message: PHP Deprecated:  preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /srv/www/SITE/public_html/wp-content/uploads/civicrm/ext/eu.tttp.noverwrite/noverwrite.php on line 15'

If the user goes directly to the profile edit form and there's no HTTP_REFERER, this change sets the value of $path to an empty string, which resolves the deprecation warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant