|
11 | 11 | $precomputed_id = (isset($_POST["unique_id"]))?($_POST["unique_id"]):(null); |
12 | 12 |
|
13 | 13 | $params_array = array("document_types", "sorting", "min_descsize"); |
14 | | -$optional_get_params = ["repo", "coll", "vis_type", "q_advanced", "lang_id", "custom_title", "exclude_date_filters", "today", "from", "to", "custom_clustering"]; |
| 14 | +$optional_get_params = ["repo", "coll", "vis_type", "q_advanced", "lang_id", "custom_title", "exclude_date_filters", "from", "to", "custom_clustering"]; |
| 15 | + |
15 | 16 |
|
16 | 17 | function filterEmptyString($value) |
17 | 18 | { |
@@ -44,6 +45,23 @@ function filterEmptyString($value) |
44 | 45 | unset($params_array["from"], $params_array["to"]); |
45 | 46 | } |
46 | 47 |
|
| 48 | +// re-establish historic order for backwards ID compatibility |
| 49 | +$historic_params_order = array("from", "to", "document_types", "sorting", "min_descsize", "repo"); |
| 50 | +$reordered_params = array(); |
| 51 | +foreach($historic_params_order as $param) { |
| 52 | + if (isset($post_params[$param])) { |
| 53 | + $reordered_params[] = $param; |
| 54 | + } |
| 55 | +} |
| 56 | +foreach($params_array as $param) { |
| 57 | + if (!in_array($param, $reordered_params)) { |
| 58 | + $reordered_params[] = $param; |
| 59 | + } |
| 60 | +} |
| 61 | +$params_array = $reordered_params; |
| 62 | + |
| 63 | + |
| 64 | + |
47 | 65 | $result = search("base", $dirty_query |
48 | 66 | , $post_params, $params_array |
49 | 67 | , true |
|
0 commit comments