From 94b6d697f9ba19ba53ce99f575ad88d60eedf3b5 Mon Sep 17 00:00:00 2001 From: flack Date: Fri, 13 Jul 2018 22:12:07 +0200 Subject: [PATCH] Remove unused alternative attachment serving methods --- lib/midcom/core/context.php | 6 ------ lib/midcom/core/dbaobject.php | 4 ---- .../service/implementation/urlparsertopic.php | 16 +++------------- 3 files changed, 3 insertions(+), 23 deletions(-) diff --git a/lib/midcom/core/context.php b/lib/midcom/core/context.php index 3181caeefe..d25c58f2ac 100644 --- a/lib/midcom/core/context.php +++ b/lib/midcom/core/context.php @@ -315,12 +315,6 @@ public function run() if (empty($object->guid)) { throw new midcom_error('Root node missing.'); } - - if ($object instanceof midcom_db_attachment) { - midcom::get()->serve_attachment($object); - // This will exit - } - } while ($this->parser->get_object() !== false); // Check whether the component can handle the request. diff --git a/lib/midcom/core/dbaobject.php b/lib/midcom/core/dbaobject.php index 41eab24657..6088f5b65b 100644 --- a/lib/midcom/core/dbaobject.php +++ b/lib/midcom/core/dbaobject.php @@ -360,10 +360,6 @@ public function purge_attachments($constraints) { return $this->__object->purge_attachments($constraints); } - public static function serve_attachment($guid) - { - midcom::get()->serve_attachment(new midcom_db_attachment($guid)); - } public function has_parameters() { return $this->__object->has_parameters(); diff --git a/lib/midcom/core/service/implementation/urlparsertopic.php b/lib/midcom/core/service/implementation/urlparsertopic.php index e34f105628..b7e2c244e9 100644 --- a/lib/midcom/core/service/implementation/urlparsertopic.php +++ b/lib/midcom/core/service/implementation/urlparsertopic.php @@ -102,22 +102,12 @@ public function get_object() // Set to current topic $this->objects[$object_url] = $qb->get_result(0); } else { - //last load returned ACCESS DENIED, no sense to dig deeper + // last load returned ACCESS DENIED, no sense to dig deeper if ($qb->denied > 0) { midcom_connection::set_error(MGD_ERR_ACCESS_DENIED); - return false; } - // No topics matching path, check for attachments - $att_qb = midcom_db_attachment::new_query_builder(); - $att_qb->add_constraint('name', '=', $this->argv[0]); - $att_qb->add_constraint('parentguid', '=', $this->get_current_object()->guid); - if ($att_qb->count() == 0) { - // allow for handler switches to work - return false; - } - - // Set as current object - $this->objects[$object_url] = $att_qb->get_result(0); + // allow for handler switches to work + return false; } } // Remove this component from path