WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Plugin: Front-end Editor] stripslashes and latex -- a fix? (2 posts)

  1. kirkpatrick
    Member
    Posted 4 years ago #

    I'm using wp-latex and/or wp-quicklatex to set math formulas; latex uses backslashes to denote its commands. I'm also using FEE 1.5.1. In its given form, FEE strips the backslashes at second edit -- that is, I can create a formula and it will display, but if I edit it with FEE, I find that the backslashes are stripped.

    The relevant code is in core.php, lines 194-6:

    $content = stripslashes_deep($_POST['content']);
    $result = $instance->save($id, $content);
    $result = @apply_filters($name, $result);

    The LaTeX packages work with the change of these lines to

    $content = $_POST['content'];
    $result = $instance->save($id, $content);
    $result = @apply_filters($name, stripslashes_deep($result));

    That is, stripslashes is applied not to what is saved but only to what is returned, so we avoid recursive stripslashing.

    I think that this is the right way to do it (regardless of the use of LaTeX) -- stripslashes should be applied to the data as it is used, not as it is saved.

    @scribu: Does this seem to you an acceptable/appropriate change?

  2. scribu
    Member
    Posted 4 years ago #

    Looks good. I've included your fix in the Development Version (1.6a3).

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic