Commit 69d05b64 authored by merlinofchaos's avatar merlinofchaos

#165611: Cached queries could have their args replaced twice, causing percent...

#165611: Cached queries could have their args replaced twice, causing percent signs to get messed up.
parent 250fdb7c
......@@ -276,14 +276,9 @@ function _views_get_query(&$view, $args, $filters) {
else {
views_load_query();
$info = _views_build_query($view, $args, $filters);
$data = array(
'query' => _views_replace_args($info['query'], $info['args']),
'countquery' => _views_replace_args($info['countquery'], $info['args']),
);
if ($view->is_cacheable) {
cache_set('views_query:' . $view->name, 'cache_views', serialize($data));
cache_set('views_query:' . $view->name, 'cache_views', serialize($info));
}
$info = array_merge($info, $data);
}
// Run-time replacement so we can do cacheing
......@@ -332,4 +327,4 @@ function _views_get_style_plugins($titles = false) {
}
}
return ($titles ? $views_style_plugins['title'] : $views_style_plugins['base']);
}
\ No newline at end of file
}
......@@ -659,16 +659,3 @@ class _views_query {
return $query;
}
}
/*
* Support db_query() style argument replacement in a clause.
*/
function _views_replace_args($clause, $args) {
// cut & pasted directly from db_query.
if (isset($args[0]) and is_array($args[0])) { // 'All arguments in one array' syntax
$args = $args[0];
}
_db_query_callback($args, TRUE);
return preg_replace_callback(DB_QUERY_REGEXP, '_db_query_callback', $clause);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment