From 75f28bf5ef9e2ea043dc585789e5c25f7aac007e Mon Sep 17 00:00:00 2001 From: Neil Pullman Date: Fri, 24 Feb 2017 10:51:47 -0500 Subject: [PATCH 1/2] replace deprecated `ereg` with `preg_match` --- includes.php | 2 +- services.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/includes.php b/includes.php index 467b3d7..3f8f010 100644 --- a/includes.php +++ b/includes.php @@ -97,7 +97,7 @@ function hookpress_print_edit_webhook( $id ){ $fields = array(); foreach ($args as $arg) { - if (ereg('[A-Z]+',$arg)) + if (preg_match('/[A-Z]+/',$arg)) $fields = array_merge($fields,hookpress_get_fields($arg)); else $fields[] = $arg; diff --git a/services.php b/services.php index 8f6b9c0..8cba350 100644 --- a/services.php +++ b/services.php @@ -10,7 +10,7 @@ function hookpress_ajax_get_fields() { $fields = array(); if (is_array($args)) { foreach ($args as $arg) { - if (ereg('[A-Z]+',$arg)) + if (preg_match('/[A-Z]+/',$arg)) $fields = array_merge($fields,hookpress_get_fields($arg)); else $fields[] = $arg; From 780a65ffad4c9d9424b37de51e1d4d3782115175 Mon Sep 17 00:00:00 2001 From: Neil Pullman Date: Fri, 24 Feb 2017 10:53:37 -0500 Subject: [PATCH 2/2] replace deprecated `split` with `explode` --- services.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services.php b/services.php index 8cba350..50299c1 100644 --- a/services.php +++ b/services.php @@ -46,7 +46,7 @@ function hookpress_ajax_add_fields() { 'type'=>$_POST['type'], 'hook'=>$_POST['hook'], 'enabled'=>$_POST['enabled'], - 'fields'=>split(',',$_POST['fields']) + 'fields'=>explode(',',$_POST['fields']) ); hookpress_update_hook( $id, $edithook ); @@ -57,7 +57,7 @@ function hookpress_ajax_add_fields() { 'url'=>$_POST['url'], 'type'=>$_POST['type'], 'hook'=>$_POST['hook'], - 'fields'=>split(',',$_POST['fields']), + 'fields'=>explode(',',$_POST['fields']), 'enabled'=>true ); $id = hookpress_add_hook($newhook);