WordPress.org

Forums

WP Biographia
[resolved] Special chars in Biography Prefix (4 posts)

  1. fabio.grasso
    Member
    Posted 1 year ago #

    Hi and thanks for this very useful plugin!

    I've found a problem with the Biography Prefix: if I use a the single quote ( ' ) character on it, In the page I see it with a back slash: \'

    I think that is related to some transformation in the php code.

    In Italian that character is widely used, for example "The author" is translated with "L'autore", with the apostrophe.

    If you can fix it in the future release I will apreciate this

    thanks!

    http://wordpress.org/plugins/wp-biographia/

  2. vicchi
    Member
    Plugin Author

    Posted 1 year ago #

    I'll take a look at this; I think there might be some cleverness with either PHP or WordPress sanitising the form field content for the prefix string. Bear with me.

    -Gary

  3. fabio.grasso
    Member
    Posted 1 year ago #

    Perfect, thanks!

  4. vicchi
    Member
    Plugin Author

    Posted 1 year ago #

    I've dug into this a bi deeper and I think it's probably more a side effect of PHP's security measures than a WordPress or plugin issue. If you're running a version of PHP prior to 5.4, then magic_quotes_gpc is on by default and this will automagically escape single and double quote characters in form fields. From 5.4 onwards, WordPress also does this for you.

    You can use WP Biographia's wp_biographia_content_title filter to remove any escaped characters in the Biography Box title before it's displayed though. Using your example of L'autore as the Biography Box prefix, the following code displays this correctly and without the escaped single quote.

    add_filter('wp_biographia_content_title', 'bio_prefix_override', 10, 3);
    function bio_prefix_override($content, $prefix, $formatted_name) {
    	return stripslashes($content);
    }

    -Gary

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Biographia
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic