Skip to content

changing the deprecated ereg() function to preg_match()#15

Open
XPERTPCNET wants to merge 1 commit intomitcho:masterfrom
XPERTPCNET:master
Open

changing the deprecated ereg() function to preg_match()#15
XPERTPCNET wants to merge 1 commit intomitcho:masterfrom
XPERTPCNET:master

Conversation

@XPERTPCNET
Copy link

When adding a Webhook, no field items are displaying after selecting actions or filters .

The following error is logged:

PHP Fatal error: Uncaught Error: Call to undefined function ereg() in /path/wp-content/plugins/hookpress/services.php:13

This was this fix:
// changing the deprecated ereg() function to preg_match()
from: if (ereg('[A-Z]+',$arg))
to: if (preg_match('/[A-Z]+/',$arg))

Copy link

@oltodo oltodo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there this line to change ?

@michaelperrin
Copy link

Hello @mitcho , do you think you will merge the PR for PSR compatibility? If not, we will have to consider to fork the project. What do you think @oltodo and @XPERTPCNET ?

@Willemdumee
Copy link

I would like to know as well. For php7 not only ereg() is deprecated, also split().
I forked the project and wanted to PR as well.

@michaelperrin
Copy link

@Willemdumee Maybe you should open an other PR with your additional changes. If @mitcho doesn't merge it, your repository could become the "official" fork, but unfortunately installing the plugin with WP CLI would install the non-forked version...

@neiltron
Copy link

@mitcho any chance of this merging? The plugin is broken on PHP 7.

@mobilewebguru
Copy link

From: if (ereg('Opera(https://cdn.freshdesignweb.com/| )([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version))

To: if (preg_match('/Opera(https://cdn.freshdesignweb.com/| )([0-9].[0-9]{1,2})/', $HTTP_USER_AGENT, $log_version))
I changed like this but error happend, what is solution?

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.

6 participants