Zen Follower
- Join Date:
- Jan 2018
- Posts:
- 157
- Plugin Contributions:
- 0
ereg to preg_match?
I have an old plugin that I am updating and I see ereg which was replaced by preg_match in php7.
Here is the code:
if ( (!isset($_GET['sort'])) || (!ereg('[1-9][ad]', $_GET['sort'])) || (substr($_GET['sort'], 0, 1) > sizeof($define_list)) ) {
Would it be changed to?
if ( (!isset($_GET['sort'])) || (!preg_match('/[1-9][ad]', $_GET['sort'])) || (substr($_GET['sort'], 0, 1) > sizeof($define_list)) ) {