WordPress.org

Support

Support » Plugins and Hacks » [Resolved] [Plugin: Front-end Editor] stripslashes and latex — a fix?

[Resolved] [Plugin: Front-end Editor] stripslashes and latex — a fix?

  • 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?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] [Plugin: Front-end Editor] stripslashes and latex — a fix?’ is closed to new replies.
Skip to toolbar