Skip to content

Commit

Permalink
#5302 Use JSON rather than PHP serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
asmecher committed Nov 26, 2019
1 parent f80352a commit 5f75a4d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions classes/statistics/PKPStatisticsHelper.inc.php
Expand Up @@ -265,11 +265,11 @@ function getReportUrl($request, $metricType, $columns, $filter, $orderBy = array
$args = array(
'metricType' => $metricType,
'columns' => $columns,
'filters' => serialize($filter)
'filters' => json_encode($filter)
);

if (!empty($orderBy)) {
$args['orderBy'] = serialize($orderBy);
$args['orderBy'] = json_encode($orderBy);
}

return $dispatcher->url($request, ROUTE_PAGE, null, 'management', 'tools', 'generateReport', $args);
Expand Down
4 changes: 2 additions & 2 deletions pages/management/PKPToolsHandler.inc.php
Expand Up @@ -194,12 +194,12 @@ function generateReport($args, $request) {
}

$columns = $request->getUserVar('columns');
$filters = unserialize($request->getUserVar('filters'));
$filters = json_decode($request->getUserVar('filters'));
if (!$filters) $filters = $request->getUserVar('filters');

$orderBy = $request->getUserVar('orderBy');
if ($orderBy) {
$orderBy = unserialize($orderBy);
$orderBy = json_decode($orderBy);
if (!$orderBy) $orderBy = $request->getUserVar('orderBy');
} else {
$orderBy = array();
Expand Down

0 comments on commit 5f75a4d

Please sign in to comment.