Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Simon Dingley 1474 posts 3431 karma points c-trib
    Sep 12, 2019 @ 09:32
    Simon Dingley
    0

    Encode Ampersands in Social Media Image Urls

    Hi Richard,

    I have a customer who needs a high accessibility ranking due to it being a public service site and we have made great efforts to achieve an almost 10/10 score.

    There is one item that has recently come to light that is flagging as something that needs addressing in regards to the HTML quality and that item is the fact that the Social Media Image urls are being output with unencoded ampersands. Is there anything that can be done to ensure they are output as encoded ampersands e.g.

    /media/1004/myimage.jpg?mode=crop&width=1200&height=630
    

    instead of ...

    media/1004/acceptance-art-1146851.jpg?mode=crop&width=1200&height=630
    

    I'm not sure there is safe workaround in the interim?

    Thanks, Simon

  • Richard Soeteman 4046 posts 12899 karma points MVP 2x
    Sep 12, 2019 @ 09:39
    Richard Soeteman
    0

    Hi Simon,

    I believe I did that before and that was causing issues with preview in Facebook etc. Will have to check..

    Best,

    Richard

  • Simon Dingley 1474 posts 3431 karma points c-trib
    Sep 16, 2019 @ 11:46
    Simon Dingley
    0

    Hi Richard - any suggestions on how to work around this? The problem I have is that its all tied up in the SeoChecker.SocialTags property and so I don't really think I can safely do a find & replace on ampersands in the HtmlString it returns.

  • Richard Soeteman 4046 posts 12899 karma points MVP 2x
    Sep 16, 2019 @ 15:20
    Richard Soeteman
    0

    Hi Simon, Can't you use the social tags as well?

  • Simon Dingley 1474 posts 3431 karma points c-trib
    Sep 24, 2019 @ 05:44
    Simon Dingley
    0

    Hi Richard - I'm not sure I follow what you mean?

  • louisjrdev 107 posts 344 karma points c-trib
    Sep 24, 2019 @ 12:56
    louisjrdev
    0

    You could try HTML encoding the urls using: HttpUtility.HtmlEncode(yourUrlValue)

    https://docs.microsoft.com/en-us/dotnet/api/system.web.httputility.htmlencode?view=netframework-4.6.2

  • Richard Soeteman 4046 posts 12899 karma points MVP 2x
    Sep 24, 2019 @ 15:34
    Richard Soeteman
    0

    Sorry Simon,

    Was thinking you could also render individual characters That isn't the case now but will implement this for V2.9 . Hope I can work on that this week and I post a Hotfix to that release here. Then you can access MetaData.Social.FacebookImage or something similar and encode that youself.

    Sorry for the hassle for now.

    Best,

    Richard

  • Simon Dingley 1474 posts 3431 karma points c-trib
    Sep 25, 2019 @ 06:29
    Simon Dingley
    0

    Then you can access MetaData.Social.FacebookImage or something similar and encode that youself.

    Thanks Richard, that would work perfectly!

  • Richard Soeteman 4046 posts 12899 karma points MVP 2x
    Sep 26, 2019 @ 08:01
    Richard Soeteman
    0

    Hi Simon, what was the version of Umbraco? Hope it's V8 ;-)

  • Simon Dingley 1474 posts 3431 karma points c-trib
    Nov 14, 2019 @ 12:44
    Simon Dingley
    0

    No, v7 I'm afraid.

  • Richard Soeteman 4046 posts 12899 karma points MVP 2x
    Oct 18, 2019 @ 06:39
    Richard Soeteman
    0

    Hi Simon,

    Forgot to reply but this issue was implemented a few weeks ago. You can download the hotfix here

    Hope this helps,

    Richard

  • Simon Dingley 1474 posts 3431 karma points c-trib
    Nov 14, 2019 @ 12:43
    Simon Dingley
    0

    Sorry I missed the update on this Richard but thanks. Do I just need the dll's out of this?

    Update: Guessing this is v8 only after extracting the dll's

Please Sign in or register to post replies

Write your reply to:

Draft