Skip to content

Commit

Permalink
Adds stripQueryFromRefurl global parameter to strip args from refurl
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey@3015 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
Thibault Le Meur committed Jun 23, 2007
1 parent c5664b2 commit 22ab681
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
12 changes: 10 additions & 2 deletions common.php
Original file line number Diff line number Diff line change
Expand Up @@ -2544,7 +2544,7 @@ function FlattenText($texttoflatten)
*/
function getreferringurl()
{
global $clang;
global $clang,$stripQueryFromRefurl;
if (isset($_SESSION['refurl']))
{
return; // do not overwrite refurl
Expand All @@ -2555,7 +2555,15 @@ function getreferringurl()
{
if(!ereg($_SERVER["SERVER_NAME"], $_SERVER["HTTP_REFERER"]))
{
$_SESSION['refurl'] = $_SERVER["HTTP_REFERER"];
if (!isset($stripQueryFromRefurl) || !$stripQueryFromRefurl)
{
$_SESSION['refurl'] = $_SERVER["HTTP_REFERER"];
}
else
{
$aRefurl = explode("?",$_SERVER["HTTP_REFERER"]);
$_SESSION['refurl'] = $aRefurl[0];
}
}
else
{
Expand Down
8 changes: 6 additions & 2 deletions config.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,15 @@
// Experimental parameters, only change if you know what you're doing
//
// $filterout_incomplete_answers
// * default behaviour of phpsv regarding answer records with no submitdate
// * default behaviour of LimeS regarding answer records with no submitdate
// * can be overwritten by module parameters
// ("Filter-Out incomplete answers" checkbox when implemented)
$filterout_incomplete_answers = true;

//
// $stripQueryFromRefurl (default is false)
// * default behaviour is to record the full referer url when requested
// * set to true in order to remove the parameter part of the referrer url
// $stripQueryFromRefurl = false;

//DO NOT CHANGE BELOW HERE --------------------

Expand Down

0 comments on commit 22ab681

Please sign in to comment.