Skip to content

Commit

Permalink
Fix more preg_match issues with [^0-9]* which should be [^0-9]
Browse files Browse the repository at this point in the history
  • Loading branch information
sc0ttkclark committed Apr 17, 2014
1 parent 1caddc7 commit dc7f40a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions classes/Pods.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit dc7f40a

Please sign in to comment.