Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixes with saving $thank_you URL

  • Loading branch information...
commit 5b70c679861a1e4bb391b4294854613a08574a34 1 parent f0c9a79
@sc0ttkclark sc0ttkclark authored
View
7 classes/PodsAPI.php
@@ -4254,8 +4254,11 @@ public function process_form ( $params, $obj = null, $fields = null, $thank_you
$id = $this->save_pod_item( $params );
- if ( 0 < $id && !empty( $thank_you ) )
- echo '<script type="text/javascript">document.location = "' . esc_js( $thank_you ) . '";</script>';
+ if ( 0 < $id && !empty( $thank_you ) ) {
+ $thank_you = str_replace( 'X_ID_X', $id, $thank_you );
+
+ die( '<script type="text/javascript">document.location = \'' . addslashes( $thank_you ) . '\';</script>' );
+ }
return $id;
}
View
4 classes/PodsUI.php
@@ -984,7 +984,7 @@ public function form ($create = false, $duplicate = false) {
$vars = array(
'action' . $this->num => $this->action_after[ 'add' ],
'do' . $this->num => 'create',
- 'id' . $this->num => ''
+ 'id' . $this->num => 'X_ID_X'
);
if ( false === $create ) {
@@ -1008,7 +1008,7 @@ public function form ($create = false, $duplicate = false) {
$vars = array(
'action' . $this->num => $this->action_after[ 'duplicate' ],
'do' . $this->num => 'create',
- 'id' . $this->num => ''
+ 'id' . $this->num => 'X_ID_X'
);
}
}
View
4 ui/admin/form.php
@@ -144,6 +144,8 @@
} );
pods_admin_submit_callback = function ( id ) {
- document.location = '<?php echo esc_js( $thank_you ); ?>';
+ var thank_you = '<?php echo addslashes( $thank_you ); ?>';
+
+ document.location = thank_you.replace( 'X_ID_X', id );
}
</script>
View
8 ui/js/jquery.pods.js
@@ -126,9 +126,9 @@
success : function ( d ) {
if ( -1 == d.indexOf( '<e>' ) && -1 != d ) {
if ( 'undefined' != typeof pods_admin_submit_callback )
- pods_admin_submit_callback( d );
+ pods_admin_submit_callback( parseInt( d ) );
else if ( 'undefined' != typeof $submittable.data( 'location' ) )
- document.location.href = $submittable.data( 'location' );
+ document.location.href = $submittable.data( 'location' ).replace( 'X_ID_X', parseInt( d ) );
else
document.location.reload( true );
}
@@ -189,9 +189,9 @@
success : function ( d ) {
if ( -1 == d.indexOf( '<e>' ) && -1 != d ) {
if ( 'undefined' != typeof pods_admin_submit_callback )
- pods_admin_submit_callback( d );
+ pods_admin_submit_callback( parseInt( d ) );
else if ( 'undefined' != typeof $submitbutton.data( 'location' ) )
- document.location.href = $submitbutton.data( 'location' );
+ document.location.href = $submitbutton.data( 'location' ).replace( 'X_ID_X', parseInt( d ) );
else
document.location.reload( true );
}
Please sign in to comment.
Something went wrong with that request. Please try again.