• Resolved delacqua

    (@delacqua)


    hi,
    using sublanguage with woocommerce products the “sort products” feature is broken.

    i’ve made a little change in the function table_views to handle HTML-encoding in links with pre-existing parameters:

    <br />
    	public function table_views($views) {<br />
    		global $sublanguage_admin;</p>
    <p>		$new_views = array();<br />
    		$new_views[] = $this->print_table_view_language_switch($sublanguage_admin->language_query_var);</p>
    <p>		foreach ($views as $view) {</p>
    <p>			if (preg_match('/href=[\'|"]([^\'"]*)/', $view, $matches)) {<br />
    				$match_decoded = html_entity_decode($matches[1]); //handle HTML encoding in links with existing parameters (IE in WooCommerce "Sort Products" link)<br />
    				$new_views[] = str_replace($matches[1], add_query_arg(array($sublanguage_admin->language_query_var => $sublanguage_admin->current_language->post_name), $match_decoded), $view);</p>
    <p>			} else {</p>
    <p>				$new_views[] = $view;</p>
    <p>			}</p>
    <p>		}</p>
    <p>		return $new_views;<br />
    	}<br />

    https://wordpress.org/plugins/sublanguage/

Viewing 1 replies (of 1 total)
  • Plugin Author maximeschoeni

    (@maximeschoeni)

    Hello,

    Thank you for fixing this issue. I’ll make the changes in the next release, so don’t worry about next update.

Viewing 1 replies (of 1 total)

The topic ‘handle HTML encoding in links with existing parameters’ is closed to new replies.