Bug 5475 - Relative URLs from Flash do not work if they start with a ? (variable string)
Summary: Relative URLs from Flash do not work if they start with a ? (variable string)
Status: RESOLVED DUPLICATE of bug 7656
Alias: None
Product: WebKit
Classification: Unclassified
Component: Plug-ins (show other bugs)
Version: 417.x
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Tim Omernick
URL: http://www.ryanair.com/site/EN/dests....
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-24 04:07 PDT by Peter Gerard
Modified: 2006-03-13 05:35 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Gerard 2005-10-24 04:07:53 PDT
I have reported this bug using the "Report bugs to Apple" feature in Safari on every version of Safari 
since Jaguar. The bug exists in all versions of Safari, including the latest 1.3 and 2.0 on Panther and 
Tiger.

If a Flash file requests an address (using getURL or a similar function) and the address is a relative one 
like '?flash=yes' then Safari incorrectly appends '?flash=yes' to the existing URL instead of replacing the 
variable string in the existing URL. This happens whenever the address requested by Flash begins with 
a '?'.

For example, on the popular Ryanair website when a user tries to view the destination map:
http://www.ryanair.com/site/EN/dests.php?flash=chk
the embedded Flash file then redirects to '?flash=yes' but Safari sends the browser to:
http://www.ryanair.com/site/EN/dests.php?flash=chk?flash=yes
instead of the correct page:
http://www.ryanair.com/site/EN/dests.php?flash=yes

This bug also affects loadVars and any other attempt to request an external URL in Flash.  On one of my 
own websites I found that I could work around the problem by doing a browser check and a redirect so 
that the repeated variable string would not cause problems. Look at:
http://www.myedinburgh.org/?area=map 
which redirects to: 
http://www.myedinburgh.org/?area=map&map_flash_saf_init=1
so it will work on Safari.
View Safari's Activity window to see how this solves the problems. The call to a variables file at:
http://www.myedinburgh.org/?area=map&map_flash_saf_init=1?
area=map&section=flashdata&getdata=init
now works because the value for 'area' is 'map' instead of 'map?' as it would have been without the 
addition of &map_flash_saf_init=1. The variable 'map_flash_saf_init' is not actually needed (it's only 
there to fix the Safari bug) so the extra '?area=map' stuck on the end doesn't mess anything up.

On other sites I have had to recode Flash files to make them work with Safari because this redirection 
workaround was not applicable.
Comment 1 Alexey Proskuryakov 2006-02-07 12:41:41 PST
I have tried to reproduce the problem on ryanair.com, but it appears to behave correctly. Could you please provide a step-by-step description of the steps necessary to reproduce the problem?

I am using Flash Player 8.0 r22.
Comment 2 Joost de Valk (AlthA) 2006-02-13 16:10:06 PST
Can't reproduce either, closing bug as worksforme. Reporter, if this still doesn't work, please reopen and tell us what you do.
Comment 3 Alexey Proskuryakov 2006-03-08 08:22:43 PST
Ok, bug 7656 has a reproducible test case for this issue (and, subsequently, a proposed fix).
Comment 4 Peter Gerard 2006-03-13 02:29:23 PST
I can confirm that the bug is still reproduceible (as of OS 10.4.5 - Safari 2.0.3 (417.8)). Ryanair may have developed a work-around in the time since I posted the bug. However, you can reproduce it by following these steps:

Visit:
http://www.myedinburgh.org/?area=map&map_flash_saf_init=1

View the Activity Window.
Notice that the Flash movie has loaded variables from the following address:
?area=map&section=flashdata&getdata=directory

However, this shows in the Activity window as:
http://www.myedinburgh.org/?area=map&map_flash_saf_init=1?area=map&section=flashdata&getdata=directory

This is incorrect. The correct behavior would be for Safari to load:
http://www.myedinburgh.org/?area=map&section=flashdata&getdata=directory

Instead Safari has appended the relative address to the entire existing URL, which causes some variables to not work.

You will not notice any problems on the page because I have added a Safari-specific workaround in the PHP that allows this incorrect URL to still work. However, the bug still persists and probably affects other websites.
Comment 5 Alexey Proskuryakov 2006-03-13 05:35:45 PST
Thank you for providing these updated steps to reproduce! I can now see the problem with Safari 2.0.3 (10.4.5).

As expected, this appears to be fixed in the latest nightlies, with bug 7656 being resolved. Nightly builds of WebKit are available from <http://nightly.webkit.org>.

*** This bug has been marked as a duplicate of 7656 ***