http://www.mediawiki.org/wiki/Special:Code/MediaWiki/96062

Revision: 96062
Author:   awjrichards
Date:     2011-09-01 23:14:50 +0000 (Thu, 01 Sep 2011)
Log Message:
-----------
Now checking for presence of array key before trying to do data substitution

Modified Paths:
--------------
    trunk/extensions/DonationInterface/payflowpro_gateway/forms/RapidHtml.php

Modified: 
trunk/extensions/DonationInterface/payflowpro_gateway/forms/RapidHtml.php
===================================================================
--- trunk/extensions/DonationInterface/payflowpro_gateway/forms/RapidHtml.php   
2011-09-01 23:05:47 UTC (rev 96061)
+++ trunk/extensions/DonationInterface/payflowpro_gateway/forms/RapidHtml.php   
2011-09-01 23:14:50 UTC (rev 96062)
@@ -135,7 +135,12 @@
                foreach ( $this->data_tokens as $token ) {
                        $key = substr( $token, 1, strlen( $token )); //get the 
token string w/o the '@'
                        if ( $key == 'emailAdd' ) $key = 'email';
-                       $form = str_replace( $token, $this->form_data[ $key ], 
$form );
+                       if ( array_key_exists( $this->form_data[ $key ] )) {
+                               $replace = $this->form_data[ $key ];
+                       } else {
+                               $replace = '';
+                       }
+                       $form = str_replace( $token, $replace, $form );
                }
                
                // replace errors


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to