From dc7f40a24de9e9e77840b5a9a563e17b6547698f Mon Sep 17 00:00:00 2001 From: Scott Kingsley Clark Date: Wed, 16 Apr 2014 19:24:36 -0500 Subject: [PATCH] Fix more preg_match issues with [^0-9]* which should be [^0-9] --- classes/Pods.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/classes/Pods.php b/classes/Pods.php index 04a3de55d6..b4ab504139 100644 --- a/classes/Pods.php +++ b/classes/Pods.php @@ -1597,7 +1597,7 @@ public function has ( $field, $value, $id = null ) { $related_ids = $this->api->lookup_related_items( $this->fields[ $field ][ 'id' ], $this->pod_data[ 'id' ], $id, $this->fields[ $field ], $this->pod_data ); foreach ( $value as $k => $v ) { - if ( !preg_match( '/[^0-9]*/', $v ) ) + if ( !preg_match( '/[^0-9]/', $v ) ) $value[ $k ] = (int) $v; // @todo Convert slugs into IDs else { @@ -1671,7 +1671,7 @@ public function is ( $field, $value, $id = null ) { $related_ids = $this->api->lookup_related_items( $this->fields[ $field ][ 'id' ], $this->pod_data[ 'id' ], $id, $this->fields[ $field ], $this->pod_data ); foreach ( $value as $k => $v ) { - if ( !preg_match( '/[^0-9]*/', $v ) ) + if ( !preg_match( '/[^0-9]/', $v ) ) $value[ $k ] = (int) $v; // @todo Convert slugs into IDs else { @@ -2481,7 +2481,7 @@ public function add_to ( $field, $value, $id = null ) { $related_ids = $this->api->lookup_related_items( $this->fields[ $field ][ 'id' ], $this->pod_data[ 'id' ], $id, $this->fields[ $field ], $this->pod_data ); foreach ( $value as $k => $v ) { - if ( !preg_match( '/[^0-9]*/', $v ) ) + if ( !preg_match( '/[^0-9]/', $v ) ) $value[ $k ] = (int) $v; } @@ -2601,7 +2601,7 @@ public function remove_from( $field, $value = null, $id = null ) { $related_ids = $this->api->lookup_related_items( $this->fields[ $field ][ 'id' ], $this->pod_data[ 'id' ], $id, $this->fields[ $field ], $this->pod_data ); foreach ( $value as $k => $v ) { - if ( !preg_match( '/[^0-9]*/', $v ) ) { + if ( !preg_match( '/[^0-9]/', $v ) ) { $value[ $k ] = (int) $v; } // @todo Convert slugs into IDs