• Resolved Paul

    (@paulschiretz)


    Hi there i solved my issue with Stripe Gateway for Woocommerce.

    https://www.ads-software.com/support/topic/conflict-with-stripe-gateway-for-woocommerce/

    In Version 1.6.3 in class-translation-manager.php on line 941 an error is thrown (stripe gateway passes an array to this function somehow):

    Basically i needed to check if $string is really a string in strip_gettext_tags of class-translation-manager.php . I only added a simple is_string($string) && to the if clause to avoid a php error if for instance an array is passed into this function.

    	/**
    	 * function that strips the gettext tags from a string
    	 * @param $string
    	 * @return mixed
    	 */
    	static function strip_gettext_tags( $string ){
    		if( is_string($string) && strpos( $string, ' data-trpgettextoriginal=' ) !== false ) {
    			$string = preg_replace('/ data-trpgettextoriginal=\d+#!trpen#/', '', $string);
    			$string = str_replace('#!trpst#trp-gettext', '', $string);
    			$string = str_replace('#!trpst#/trp-gettext', '', $string);
    			$string = str_replace('#!trpst#\/trp-gettext', '', $string);
    			$string = str_replace('#!trpen#', '', $string);
    		}
    
    		return $string;
    	}

    It’s a very simple fix and i think it might also solve a 3 months old issue of your plugin:

    https://www.ads-software.com/support/topic/error-messages-issue/

    Hope I could have been of some help.
    Please let me know if you added it to your next update so I’m future save again.

    Thanks
    Paul

    PS: I’m a c++ dev Types are my friends ??

    • This topic was modified 4 years, 11 months ago by Paul.
    • This topic was modified 4 years, 11 months ago by Paul.
Viewing 1 replies (of 1 total)
  • Dragos

    (@dragosvrejiu)

    Hello Paul,

    Thank your for the fix you have provided.

    Indeed, it is helpful and we will almost certainly add it in the next version of TranslatePress.

    I will get back to you when it is implemented.

    With the best wishes,

Viewing 1 replies (of 1 total)
  • The topic ‘Code Submit Request (FIX for Stripe Gateway)’ is closed to new replies.