diff options
Diffstat (limited to 'modules/g2_import')
-rw-r--r-- | modules/g2_import/controllers/g2.php | 12 | ||||
-rw-r--r-- | modules/g2_import/helpers/g2_import_installer.php | 1 |
2 files changed, 6 insertions, 7 deletions
diff --git a/modules/g2_import/controllers/g2.php b/modules/g2_import/controllers/g2.php index abbf87a0..c24d52e9 100644 --- a/modules/g2_import/controllers/g2.php +++ b/modules/g2_import/controllers/g2.php @@ -46,7 +46,7 @@ class G2_Controller extends Controller { } if (!$id) { - url::redirect("tag_name/$tag_name"); + url::redirect("tag_name/$tag_name", 301); } $tag = ORM::factory("tag")->where("name", "=", $tag_name)->find(); @@ -68,7 +68,7 @@ class G2_Controller extends Controller { 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%"); + $where[] = array("g2_url", "LIKE", "%" . Database::escape_for_like("g2_view=$view") . "%"); } // else: Assuming that the first search hit is sufficiently good. } else if ($path) { $where = array(array("g2_url", "IN", array($path, str_replace(" ", "+", $path)))); @@ -99,18 +99,18 @@ class G2_Controller extends Controller { // Redirect the user to the new url switch ($resource_type) { case "thumbnail": - url::redirect($item->thumb_url(true)); + url::redirect($item->thumb_url(true), 301); case "resize": - url::redirect($item->resize_url(true)); + url::redirect($item->resize_url(true), 301); case "file": case "full": - url::redirect($item->file_url(true)); + url::redirect($item->file_url(true), 301); case "item": case "album": - url::redirect($item->abs_url()); + url::redirect($item->abs_url(), 301); case "group": case "user": diff --git a/modules/g2_import/helpers/g2_import_installer.php b/modules/g2_import/helpers/g2_import_installer.php index b0c14425..c7569819 100644 --- a/modules/g2_import/helpers/g2_import_installer.php +++ b/modules/g2_import/helpers/g2_import_installer.php @@ -31,7 +31,6 @@ class g2_import_installer { KEY `g2_id` (`g2_id`)) DEFAULT CHARSET=utf8;"); - module::set_version("g2_import", 2); mkdir(VARPATH . "modules/g2_import"); } |