diff --git a/src/messenger/webim/client.php b/src/messenger/webim/client.php
index 7f7b7ae2..61c64de8 100644
--- a/src/messenger/webim/client.php
+++ b/src/messenger/webim/client.php
@@ -32,7 +32,11 @@ if( !isset($_GET['token']) || !isset($_GET['thread']) ) {
exit;
}
- $referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : "";
+ $referer = isset($_GET['url']) ? $_GET['url'] :
+ (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : "");
+ if(isset($_GET['referrer']) && $_GET['referrer']) {
+ $referer .= "\n".$_GET['referrer'];
+ }
$extAddr = $_SERVER['REMOTE_ADDR'];
if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) &&
$_SERVER['HTTP_X_FORWARDED_FOR'] != $_SERVER['REMOTE_ADDR']) {
diff --git a/src/messenger/webim/install/whatsnew.txt b/src/messenger/webim/install/whatsnew.txt
index d8f433c9..bc1b6cab 100644
--- a/src/messenger/webim/install/whatsnew.txt
+++ b/src/messenger/webim/install/whatsnew.txt
@@ -1,3 +1,8 @@
+ 1.5.2
+ -----
+ [!] lost query parameters after login redirect
+ [+] added referrer into button code
+
1.5.1
-----
[!] significant optimization of chat window (both themes), reduced number of images and their sizes
diff --git a/src/messenger/webim/libs/common.php b/src/messenger/webim/libs/common.php
index d355dbf8..a9b8671c 100644
--- a/src/messenger/webim/libs/common.php
+++ b/src/messenger/webim/libs/common.php
@@ -343,8 +343,9 @@ function wrong_field($key) {
return getlocal2("errors.wrong_field",array(getlocal($key)));
}
-function get_popup($href,$message,$title,$wndName,$options) {
- return "$message";
+function get_popup($href,$jshref,$message,$title,$wndName,$options) {
+ if(!$jshref) { $jshref = "'$href'"; }
+ return "$message";
}
function get_image($href,$width,$height) {
diff --git a/src/messenger/webim/libs/operator.php b/src/messenger/webim/libs/operator.php
index 1c8b8389..fa61a0c7 100644
--- a/src/messenger/webim/libs/operator.php
+++ b/src/messenger/webim/libs/operator.php
@@ -126,8 +126,9 @@ function get_operator_name($operator) {
}
function generate_button($title,$locale,$style,$inner,$showhost,$forcesecure) {
- $link = get_app_location($showhost,$forcesecure)."/client.php". ($locale?"?locale=$locale" : "").($style ? ($locale?"&":"?")."style=$style" : "");
- $temp = get_popup($link, $inner, $title, "webim", "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,width=640,height=480,resizable=1" );
+ $link = get_app_location($showhost,$forcesecure)."/client.php". ($locale?"?locale=$locale" : "").($style ? ($locale?"&":"?")."style=$style" : "");
+ $temp = get_popup($link, "'$link".($locale||$style?"&":"?")."url='+escape(document.location.href)+'&referrer='+escape(document.referrer)",
+ $inner, $title, "webim", "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,width=640,height=480,resizable=1" );
return "".$temp."";
}
@@ -142,7 +143,11 @@ function check_login() {
return $op;
}
}
- $_SESSION['backpath'] = $_SERVER['PHP_SELF'];
+ $requested = $_SERVER['PHP_SELF'];
+ if($_SERVER['REQUEST_METHOD'] == 'GET' && $_SERVER['QUERY_STRING']) {
+ $requested .= "?".$_SERVER['QUERY_STRING'];
+ }
+ $_SESSION['backpath'] = $requested;
header("Location: $webimroot/operator/login.php");
exit;
}
diff --git a/src/messenger/webim/operator/translate.php b/src/messenger/webim/operator/translate.php
index b70b1acf..67727a1c 100644
--- a/src/messenger/webim/operator/translate.php
+++ b/src/messenger/webim/operator/translate.php
@@ -86,12 +86,14 @@ if($stringid) {
if(isset($_POST['translation'])) {
$translation = getparam('translation');
-
if(!$translation) {
$errors[] = no_field("form.field.translation");
}
if(count($errors) == 0) {
+ if (get_magic_quotes_gpc()) {
+ $translation = stripslashes($translation);
+ }
save_message($target, $stringid, $translation);
$page['saved'] = true;
diff --git a/src/messenger/webim/operator/update.php b/src/messenger/webim/operator/update.php
index f68dad50..c0284672 100644
--- a/src/messenger/webim/operator/update.php
+++ b/src/messenger/webim/operator/update.php
@@ -72,7 +72,7 @@ function get_user_addr($addr) {
global $settings;
if($settings['geolink'] && preg_match( "/(\\d+\\.\\d+\\.\\d+\\.\\d+)/", $addr, $matches )) {
$userip = $matches[1];
- return get_popup(str_replace("{ip}", $userip, $settings['geolink']), htmlspecialchars($addr), "GeoLocation", "ip$userip", $settings['geolinkparams']);
+ return get_popup(str_replace("{ip}", $userip, $settings['geolink']), '', htmlspecialchars($addr), "GeoLocation", "ip$userip", $settings['geolinkparams']);
}
return htmlspecialchars($addr);
}