mitcho / hookpress

HookPress
58 stars 57 forks source link

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

Open XPERTPCNET opened 8 years ago

XPERTPCNET commented 8 years ago

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))

michaelperrin commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

@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 commented 7 years ago

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

mobilewebguru commented 5 years ago

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?