Support » Plugin: Duplicate Page » Escape character ignored “\n” -> “n” (“duplicate this” on Woody ad snippet)

  • Resolved myphixu

    (@myphixu)


    Dear support,

    applying “Duplicate this” on a Woody ad snippet removes all escape characters “\” from the script/code. Sometimes the issue is obvious and the coder corrects it easily (copies manually), but sometimes the error is invisible until real/data debugging, for example when using
    explode("\n", $content);
    PHP command in the code.

    The expected behavior is that the escape character “\” would not be removed.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author mndpsingh287

    (@mndpsingh287)

    Hey @myphixu,

    Duplicate Page plugin only clones website pages content not PHP code.

    Regards,
    Mandeep

    Dear mndpsingh287

    the “Duplicate This” command is displayed for all items stored in the wp_posts SQL table — and that is very perfect and very useful. (The Woody ad snippets are stored there as well.) But leaving out or ignoring the escape char “\” can be annoying also for pages.

    I tested the issue with a PHP snippet and with the same PHP code displayed on the page in HTML:
    The code snippet
    <? $url_external_posts_array = explode("\n", $url_external_posts); ?>
    duplicates to
    <? $url_external_posts_array = explode("n", $url_external_posts); ?>
    (note the missing \ in "\n")

    The html text in a regular WP post (ignore that it can be any PHP code — the important is that there is a "\n" string)
    <p><? $url_external_posts_array = explode("\n", $url_external_posts);?></p>
    duplicates to
    <p><? $url_external_posts_array = explode("n", $url_external_posts);?></p>
    (note the missing \ in "\n")

    So the duplicate process somewhere filtered out the escape characters. It does not seem to be a 1 to 1 copy. So, if someone displays code containing escape characters \, the text and the information can be faulty and misleading after duplicating.

    • This reply was modified 2 months, 3 weeks ago by myphixu.
    • This reply was modified 2 months, 3 weeks ago by myphixu.
    • This reply was modified 2 months, 3 weeks ago by myphixu.
    • This reply was modified 2 months, 3 weeks ago by myphixu.
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.