Skip to content

Commit

Permalink
fix VisitorLog is not working for users having magic quotes enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
tsteur committed Nov 14, 2013
1 parent c9a3172 commit 9ba9d46
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions core/ViewDataTable/Factory.php
Expand Up @@ -60,15 +60,20 @@ public static function build($defaultType = null, $apiAction = false, $controlle
$defaultType = $defaultViewType;
}

$type = Common::getRequestVar('viewDataTable', $defaultType ? : HtmlTable::ID, 'string');
$type = Common::getRequestVar('viewDataTable', false, 'string');
// Common::getRequestVar removes backslashes from the defaultValue in case magic quotes are enabled.
// therefore do not pass this as a default value to getRequestVar()
if ('' === $type) {
$type = $defaultType ? : HtmlTable::ID;
}

$visualizations = Manager::getAvailableViewDataTables();

if (array_key_exists($type, $visualizations)) {
return new $visualizations[$type]($controllerAction, $apiAction);
}

if (class_exists($type, false) || class_exists($type)) {
if (class_exists($type)) {
return new $type($controllerAction, $apiAction);
}

Expand Down

0 comments on commit 9ba9d46

Please sign in to comment.