• I have MathJax enabled on my website so that math equations can be rendered. I create a post with title A Blog with $a=b\sin\theta$ as equation and use the same as test content.

    Wordpress displays that blog with both the title and context correctly with the equation rendered correctly.

    However, this plugin strips the backslashes from the title and the forum topic renders the title incorrectly but the content correctly.

    Now, if I create a topic manually with the math title and content, then both the title and content is rendered correctly.

    Therefore, this plugin strips erroneously backslashes from the title. Thanks in advance for looking into this matter.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Nick

    (@nickchomey)

    We were forced by the plugin moderation team to add mechanisms to strip all tags and other stuff from any text that is output by the plugin. You can look at the most recent few support posts here to see others who have had similar issues. Until we figure out some compromise/workaround, you’ll be best-off modifying the code in your plugin directly to display what you want. Plugin updates are extremely infrequent, so it shouldn’t be much of a hassle.

    @robin-w we have to do something about the recently-enforced changes. They’ve clearly caused unnecessary issues for all sorts of users, and surely haven’t done much to improve security.

    Plugin Author Nick

    (@nickchomey)

    Thread Starter antonv

    (@antonv)

    Thanks for that info

    However, I looked at the code and there is an easy fix by adding the function addslashes to the post_title as you did with the topic_content earlier in the code. Below lines 484 to 495 of index.php

    $topic_content = str_replace( array_keys($shortcodes), array_values($shortcodes), $topic_content );
    $topic_content = apply_filters( 'bbppt_topic_content', addslashes( $topic_content ), $post->ID );
    
    $new_topic_data = array(
       'post_parent'   => (int)$topic_forum,
       'post_author'   => $post->post_author,
       'post_content'  => $topic_content,
       'post_title'    => addslashes($post->post_title),  // added addslashes
       'post_date'		=> $post->post_date,
       'post_date_gmt'	=> $post->post_date_gmt,
        'post_name'   => $post->post_name
    );

    This should have no objections from the plugin moderators, in my opinion.

    Plugin Author Nick

    (@nickchomey)

    Thanks very much – we’ll take it into consideration. In the meantime, it should solve your problem if you implement it yourself. We don’t have plans to update the plugin for a while, so don’t worry about the changes getting overridden.

    Plugin Author Robin W

    (@robin-w)

    @robin-w we have to do something about the recently-enforced changes. They’ve clearly caused unnecessary issues for all sorts of users, and surely haven’t done much to improve security.

    agree – let me take a look when I get time

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Backslashes removed from title – MathJax enabled’ is closed to new replies.