Skip to content

Instantly share code, notes, and snippets.

@rulatir
Created January 30, 2013 23:37
Show Gist options
  • Save rulatir/4678438 to your computer and use it in GitHub Desktop.
Save rulatir/4678438 to your computer and use it in GitHub Desktop.
Patch for Pods issue 871.
diff -uNr ./classes/PodsAPI.php /home/rulatir/mnt/mp/wordpress/wp-content/plugins/pods/classes/PodsAPI.php
--- ./classes/PodsAPI.php 2013-01-06 06:29:06.000000000 +0100
+++ /home/rulatir/mnt/mp/wordpress/wp-content/plugins/pods/classes/PodsAPI.php 2013-01-31 00:09:26.000000000 +0100
@@ -1601,7 +1601,7 @@
$params->pod = $pod[ 'name' ];
$params->pod_data = $pod;
- $params->name = pods_clean_name( $params->name );
+ $params->name = pods_clean_name( $params->name, true, false );
if ( !isset( $params->id ) )
$params->id = 0;
@@ -1617,7 +1617,7 @@
if ( !empty( $field ) ) {
$old_id = pods_var( 'id', $field );
- $old_name = pods_clean_name( $field[ 'name' ] );
+ $old_name = pods_clean_name( $field[ 'name' ], true, false );
$old_type = $field[ 'type' ];
$old_options = $field[ 'options' ];
$old_sister_id = (int) pods_var( 'sister_id', $old_options, 0 );
@@ -4090,7 +4090,7 @@
if ( empty( $params->name ) && empty( $params->pod ) && empty( $params->pod_id ) )
return pods_error( __( 'Either Field Name or Field ID / Pod ID are required', 'pods' ), $this );
- $params->name = pods_clean_name( $params->name );
+ $params->name = pods_clean_name( $params->name, true, false );
if ( isset( $pod[ 'fields' ][ $params->name ] ) && isset( $pod[ 'fields' ][ $params->name ][ 'id' ] ) )
return $pod[ 'fields' ][ $params->name ];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment