WordPress.org

Support

Support » Plugins and Hacks » Carriage returns being replaced by "rn" on save

Carriage returns being replaced by "rn" on save

  • For example if I enter:

    function user_role_update( $user_id, $new_role ) {
    	echo 'hello world';
    }
    add_action( 'set_user_role', 'user_role_update', 10, 2);

    then on ‘save’ it becomes:

    function user_role_update( $user_id, $new_role ) {rn    echo 'hello world';rn     }rnadd_action( 'set_user_role', 'user_role_update', 10, 2);

    and it’s breaking my site/snippets. This occurred after the latest wordpress update and code snippet update (I’m running latest versions of both). I tried deactivating other plugins but it doesn’t help.

    Help!

    http://wordpress.org/plugins/code-snippets/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Update (not solved): it appears the bigger problem is that none of my changes are being saved. On the latest round of wordpress updates all of my code snippet carriage returns were turned into “rn” (no other posts were affected). When I try and correct this and click save it is just not saving the changes and then returning the old version.

    I turned off my cacheing plugin (w3 total) and that had no effect. Any ideas?

    Plugin Author Shea Bunge

    @bungeshea

    That’s really strange. On my test sites, I can successfully add a new snippet, and edit an existing snippet with no problems at all. I wonder what the problem could be?

    Plugin Author Shea Bunge

    @bungeshea

    Have you tried looking at the raw snippet code in the database table? What do the snippets look like there?

    It is very strange. For some of my snippets I had to create and save a new snippet, for others I was able to save it once, but then subsequent saves didn’t work. I haven’t dug into your code to see what sort of validation occurs but updated=1 in the query string so it seems to be passing whatever tests it is undergoing.

    Any ideas on where to start looking would be appreciated.

    I’m going to sleep now but will check out the database tomorrow. Where are the snippets stored?

    I haven’t noticed a pattern to whether or not a save is successful. I changed one long snippet to a simple echo snippet and it saved just fine. Then I tried changing the text of the echo statement (from ‘test’ to ‘dfdfd’) and that wouldn’t save.

    Thanks for your help.

    Plugin Author Shea Bunge

    @bungeshea

    The snippets are stored in the wp_snippets table (wp_ will be whatever your DB prefix is set to). I’ll have a look to see if there is something in the plugin code causing the problem.

    Plugin Author Shea Bunge

    @bungeshea

    Can I check if this issue was resolved in 1.9?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Carriage returns being replaced by "rn" on save’ is closed to new replies.