Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace split and ereg #20

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion includes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions services.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 );

Expand All @@ -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);
Expand Down