hookpress
hookpress copied to clipboard
Blank mutliselect fields after selecting actions or filters --ereg() deprecated PHP7.0..
When adding a Webhook, no fields 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
Two possible solutions:
Solution 1
// changing the deprecated ereg() function to mb_ereg()
from: if (ereg('[A-Z]+',$arg))
to: if (mb_ereg('[A-Z]+',$arg))
Solution 2 (seems to be more recommended):
// changing the deprecated ereg() function to preg_match()
from: if (ereg('[A-Z]+',$arg))
to: if (preg_match('/[A-Z]+/',$arg))
Same problem with split
function