HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

"Page not found" in Safari for embedded forum with UTF8 category names

AmiraliAmirali New
edited May 2015 in Feedback

Hi.

I have this strange issue with embedded forum (2.1.9) in wordpress when viewing with Safari (latest version). The forum is in Persian(Farsi) language and therefore category names are unicode characters. everything seems fine in any other browser but when user clicks on a category link, Safari shows the category page for a fraction of a second and then throws the "Whoops, page not found" error. things are fine when forum is not embedded and accessed directly.

I tracked down the issue to a bug in Safari about dealing with hashes in URL. some suggestions ( 1, 2 ) were to replace window.location.hash with window.location.href in embed.js, but this made things worst. I then changed line 139 of embed.js from

window.location.hash = currentPath;
to
window.location.href = '#' + currentPath;

But with no improvement. Still loads fine everywhere else apart from Safari, giving same error.

Forum location: http://www.iorff.com/fa/discussions/
_
Since it is in Persian, the main category links are the ones with large blue icons._

I appreciate any suggestions, other than forgetting about the embed.js and using an iframe instead ;)

Tagged:

Comments

  • Options

    I can only emulate safari through linux/wine. So my tests were inconclusive, it difficult to test under this.

    I think you have a Byte Order Mark at the start of you master template which can cause issues.

    grep is your friend.

  • Options

    @x00 said:
    I can only emulate safari through linux/wine. So my tests were inconclusive, it difficult to test under this.

    I think you have a Byte Order Mark at the start of you master template which can cause issues.

    Thanks for the reply.
    I went through all my template files and other stuff with notepad++ and tried to remove the BOM, but the problem persists as well as the BOM!

    I guess the main cause is still how safari handles hash in Urls (see here)

    As a temporary workaround, I changed the addresses of categories manually via dashboard and replaced them with latin characters. The problem is gone. but it is not a bug fix.

  • Options
    hgtonighthgtonight ∞ · New Moderator

    @Amirali according to that page it is a straight up bug on Safari's end. Nothing should be done on your application's end other than notifying users of their buggy browser.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Options
    x00x00 MVP
    edited May 2015

    You can remove BOM with

    cd /your/forum/dir
    grep -orHbm1I "^`echo -ne '\xef\xbb\xbf'`" . | sed '/:0:/!d;s/:0:.*//'

    grep is your friend.

Sign In or Register to comment.