summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2011-05-02 21:37:04 -0700
committerBharat Mediratta <bharat@menalto.com>2011-05-02 21:37:04 -0700
commit229bfc5c7c760c53d1357503fd61bf9a165acf6e (patch)
treec8d8dc52b9c62577f992ce460f7f2ba4004849d4
parent68370b92f5f6fa68744655f8c68b4b0ca59bf4fd (diff)
Track and redirect core.DownloadItem requests properly. This can
happen if the G2 was imported with rewrite on, so the g2_url in the g2_map table has a shortened url, but then rewrite is disabled and the .htaccess mod_rewrite rules are sending over a &g2_view=core.DownloadItem request. Fixes #1728.
-rw-r--r--modules/g2_import/controllers/g2.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/g2_import/controllers/g2.php b/modules/g2_import/controllers/g2.php
index 6e60bed0..90984e84 100644
--- a/modules/g2_import/controllers/g2.php
+++ b/modules/g2_import/controllers/g2.php
@@ -41,7 +41,9 @@ class G2_Controller extends Controller {
// (bbcode, embedding) people are using the id style URLs although URL rewriting is enabled.
$where = array(array("g2_id", "=", $id));
$view = $input->get("g2_view");
- if ($view) {
+ if ($view == "core.DownloadItem") {
+ $where[] = array("resource_type", "IN", array("file", "resize", "thumbnail", "full"));
+ } else if ($view) {
$where[] = array("g2_url", "like", "%g2_view=$view%");
} // else: Assuming that the first search hit is sufficiently good.
} else if ($path) {