Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Consider part of url after '?' as querystring, no matter what preceed…

…s it.

Flash doesn't recognize '#' symbol as the beginning of the fragment to
ignore, so if '?' mark follows, remaining part of the url will still be
interpreted as application parameters… wtf?
  • Loading branch information...
commit b61ac518ffa2657e2dc9019b2dcf2f3f37dbfab0 1 parent 0c5d2de
@jayarjo jayarjo authored
Showing with 10 additions and 9 deletions.
  1. +10 −9 src/moxieplayer.as
View
19 src/moxieplayer.as
@@ -22,7 +22,7 @@ package
import flash.ui.Mouse;
import flash.utils.ByteArray;
import flash.utils.setTimeout;
-
+
import mxi.Utils;
import mxi.player.Controls;
import mxi.player.ControlsEvent;
@@ -57,16 +57,17 @@ package
public function moxieplayer()
{
// use only FlashVars, ignore QueryString
- var url:String, urlParts:Object, query:Object;
+ var url:String, urlParts:Object, pos:int, query:Object;
params = root.loaderInfo.parameters;
- urlParts = Utils.parseUrl(root.loaderInfo.url);
- query = Utils.parseStr(urlParts['query']);
-
- for (var key:String in params) {
- params[key] = Utils.trim(params[key]);
- if (params[key] == query[key]) {
- delete params[key];
+ pos = root.loaderInfo.url.indexOf('?');
+ if (pos !== -1) {
+ query = Utils.parseStr(root.loaderInfo.url.substr(pos + 1));
+
+ for (var key:String in params) {
+ if (query.hasOwnProperty(Utils.trim(key))) {
+ delete params[key];
+ }
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.