[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash server/swf/ASHandlers.cpp ChangeLog
From: |
Rob Savoye |
Subject: |
[Gnash-commit] gnash server/swf/ASHandlers.cpp ChangeLog |
Date: |
Sun, 20 Aug 2006 00:17:40 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Rob Savoye <rsavoye> 06/08/20 00:17:40
Modified files:
server/swf : ASHandlers.cpp
. : ChangeLog
Log message:
* server/swf/ASHandlers.cpp (CommonGetUrl): Check the domain,
and
don't go to the remote URL if it's in the blacklist. This
ignores
all attempts to allow the non-local domain if listed.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf/ASHandlers.cpp?cvsroot=gnash&r1=1.51&r2=1.52
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.657&r2=1.658
Patches:
Index: server/swf/ASHandlers.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/swf/ASHandlers.cpp,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -b -r1.51 -r1.52
--- server/swf/ASHandlers.cpp 19 Aug 2006 13:52:48 -0000 1.51
+++ server/swf/ASHandlers.cpp 20 Aug 2006 00:17:40 -0000 1.52
@@ -40,6 +40,7 @@
#include "log.h"
#include "swf.h"
+#include "rc.h"
#include "ASHandlers.h"
#include "movie_definition.h"
#include "array.h"
@@ -70,6 +71,7 @@
}
namespace gnash {
+
namespace SWF { // gnash::SWF
#if ! (defined(_WIN32) || defined(WIN32))
@@ -1565,6 +1567,38 @@
log_error("get url2: target %s not found", target);
}
#else
+ // Strip the hostname off the URL and make sure it's
+ // not on the blacklist. For Blacklisted items, we
+ // ignor all attempts by the movie to allow the
+ // external domain.
+ string::size_type first_colon;
+ string::size_type second_colon;
+ string::size_type single_slash;
+ string::size_type double_slash;
+
+ // protocol:[//host][:port]/appname/[instanceName]
+ string urlstr = url;
+ string host;
+ first_colon = urlstr.find(':', 0);
+ second_colon = urlstr.find(':', first_colon + 1);
+ double_slash = urlstr.find("//", 0) + 2;
+ single_slash = urlstr.find("/", double_slash);
+ if (second_colon != string::npos) {
+ host = urlstr.substr(double_slash, second_colon -
double_slash);
+ } else {
+ host = urlstr.substr(double_slash, single_slash -
double_slash);
+ }
+
+ std::vector<std::string>::iterator it;
+ std::vector<std::string> blacklist = rcfile.getBlackList();
+ for (it = blacklist.begin(); it != blacklist.end(); ++it) {
+ if (*it == host) {
+ dbglogfile << "Blacklisted host " << host.c_str() <<
"!"
+ << std::endl;
+ return;
+ }
+ }
+
string command = "firefox -remote \"openurl(";
command += url;
command += ")\"";
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.657
retrieving revision 1.658
diff -u -b -r1.657 -r1.658
--- ChangeLog 19 Aug 2006 18:51:20 -0000 1.657
+++ ChangeLog 20 Aug 2006 00:17:40 -0000 1.658
@@ -1,3 +1,9 @@
+2006-08-19 Rob Savoye <address@hidden>
+
+ * server/swf/ASHandlers.cpp (CommonGetUrl): Check the domain, and
+ don't go to the remote URL if it's in the blacklist. This ignores
+ all attempts to allow the non-local domain if listed.
+
2006-08-19 Bastiaan Jacques <address@hidden>
* plugin/klash/klash_part.cpp: Make extra sure we don't kill all