Skip to content

Instantly share code, notes, and snippets.

@nhp
Created November 9, 2015 10:31
Show Gist options
  • Save nhp/47d5379b6995bfad0f41 to your computer and use it in GitHub Desktop.
Save nhp/47d5379b6995bfad0f41 to your computer and use it in GitHub Desktop.
custom AdminUrl Fix without bc breaks
diff --git a/app/code/core/Mage/Adminhtml/controllers/IndexController.php b/app/code/core/Mage/Adminhtml/controllers/IndexController.php
index 5c786d5..b99705a 100644
--- a/app/code/core/Mage/Adminhtml/controllers/IndexController.php
+++ b/app/code/core/Mage/Adminhtml/controllers/IndexController.php
@@ -75,6 +75,11 @@ class Mage_Adminhtml_IndexController extends Mage_Adminhtml_Controller_Action
$this->_redirect('*');
return;
}
+ if (!in_Array(Mage::getConfig()->getNode(Mage_Adminhtml_Helper_Data::XML_PATH_ADMINHTML_ROUTER_FRONTNAME), explode(DS, $this->getRequest()->getRequestUri()))) {
+ $this->_redirect('cms/index/noRoute');
+ return;
+ }
+
$loginData = $this->getRequest()->getParam('login');
$username = (is_array($loginData) && array_key_exists('username', $loginData)) ? $loginData['username'] : null;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment