mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-08-19 13:25:36 -04:00
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.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user