WordPress.org

Ready to get started?Download WordPress

Forums

Social Linkz
[resolved] ampersand should be html entities (6 posts)

  1. atao
    Member
    Posted 5 months ago #

    Hello

    In file social-linkz/social-linkz.php, there are some ampersands that should be defined as html entities, e.g.:

    - for linkedin, ligne 765, 3 times:
    <a rel="nofollow" target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&url=<?php echo urlencode($long_url) ; ?>&title=<?php echo str_replace('+','%20',urlencode("[Blog] ".$titre)) ; ?>&source=<?php echo urlencode(get_bloginfo('name')) ; ?>" title="<?php echo sprintf(__("Share -%s- on %s", $this->pluginID), htmlentities($titre, ENT_QUOTES, 'UTF-8'), "LinkedIn") ; ?>">

    - for viadeo, ligne 788, 3 times:

    <a rel="nofollow" target="_blank" href="http://www.viadeo.com/shareit/share/?url=<?php echo urlencode($long_url) ; ?>&title=<?php echo str_replace('+','%20',urlencode("[Blog] ".$titre)) ; ?>&overview=<?php echo str_replace('+','%20',urlencode("[Blog] ".$titre)) ; ?>" title="<?php echo sprintf(__("Share -%s- on %s", $this->pluginID), htmlentities($titre, ENT_QUOTES, 'UTF-8'), "Viadeo") ; ?>">

    - ...

    Regards

    https://wordpress.org/plugins/social-linkz/

  2. Sed Lex
    Member
    Plugin Author

    Posted 5 months ago #

    why do you believe that this & should en transform into html entities ?
    The & are inside a url and I do not see any issue with that

  3. atao
    Member
    Posted 5 months ago #

    The "&" will be used as it in the generated document, i.e. we'll get things such as "&title", "&overview"...

    When I check the generated page with http://validator.w3.org, I get this kind of messages:

    Error Line 130, Column 1795: & did not start a character reference. (& probably should have been escaped as &.)
    
    …-sortir-de-la-logique-de-supermarch%2F&title=%5BBlog%5D%20Recherche%20d%E2%80%…

    But "&title;", or here "&title", is not a valid entity. An ampersand is allowed by specification only as start of an entity. If there is any other ampersand, the document can't be validated.

  4. Sed Lex
    Member
    Plugin Author

    Posted 5 months ago #

    Ok I understand ... but the hard thing is that I believe that some browser will be lost if I write & amp; instead of & ...
    I have to check it

  5. atao
    Member
    Posted 5 months ago #

    In social-linkz/social-linkz.php, there are already some "&" used in same context

  6. Sed Lex
    Member
    Plugin Author

    Posted 5 months ago #

    Will be corrected in the next version

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.