WordPress.org

Support

Support » Plugins and Hacks » User Meta Manager » [Resolved] Usermeta values with apostrophe returned with backslash

[Resolved] Usermeta values with apostrophe returned with backslash

  • festsoft

    @festsoft

    A custom user meta field value like O’Reilly is stored in wp_usermeta as O\’Reilly [1] and displayed as O\’Reilly [2] in the User Meta Manager table and when I access it with get_user_meta(). This does not happen with the wp-user field values, which are O’Reilly in the database and when accessed. Is there a known work-round for this please?

    Note [1] and [2] in case this post does not display as intended the value I am reporting is: O[backslash][apostrophe]Reilly

    http://wordpress.org/plugins/user-meta-manager/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author President McCheese

    @jason-lau

    Use PHP function stripslashes($string).

    Example:

    $string = get_user_meta($user_id, 'my_custom_meta', true);
    echo stripslashes($string);

    Yes, I know about stripslashes, but it is complicated for me to edit UMM to apply that fix to the User Meta Manager table. And I do not have to use stripslashes when accessing wp-user values. So is this a bug in UMM?

    Plugin Author President McCheese

    @jason-lau

    Sorry, I misunderstood the question.

    Yes, it could be a bug. I will have a look.

    Plugin Author President McCheese

    @jason-lau

    This is fixed in version 3.1.1. Thanks!

    Thanks, it is partially fixed. Slashes are removed from the table, but it would be good to remove them from the database insertion code. A UMM custom meta-data field in wp_usermeta table is eg O\’Reilly whereas in the same table the WP ‘last_name’ field is correctly O’Reilly.

    PS: Sorry if confusing – slashes are removed from the displayed table but not from the MySQL database table wp_usermeta.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Resolved] Usermeta values with apostrophe returned with backslash’ is closed to new replies.
Skip to toolbar