From: Roger <roger@jikos.cz>
Date: Thu, 20 Mar 2008 09:27:52 +0000 (+0100)
Subject: Bug #83 - Single-quote passed URL and encode single-quotes in it
X-Git-Url: http://repo.or.cz/w/centerim.git?a=commitdiff_plain;h=915b3a7ade7a9830236eb6675ef13a8bc32238ce
Bug #83 - Single-quote passed URL and encode single-quotes in it
---
diff --git a/src/icqconf.cc b/src/icqconf.cc
index ac5a5d2..192e17f 100644
--- a/src/icqconf.cc
+++ b/src/icqconf.cc
@@ -1170,8 +1170,19 @@ string icqconf::execaction(const string &name, const string ¶m) {
char ch;
if(name == "openurl")
- while((npos = torun.find("$url$")) != -1)
- torun.replace(npos, 5, param);
+ {
+ string url = param;
+ int pos = 0;
+
+ while((pos = url.find("'", pos)) != -1) {
+ url.replace(pos, 1, "%27");
+ pos+=3;
+ }
+ url.insert(url.begin(), '\'');
+ url.push_back('\'');
+ while((npos = torun.find("$url$")) != -1)
+ torun.replace(npos, 5, url);
+ }
if(!pipe(inpipe) && !pipe(outpipe)) {
memset(&sact, 0, sizeof(sact));