Problem
As it stands, the menu system checks all menu paths pointing to internal links (ie, node/add or user/logout) upon submission to verify:
- The path exists in the menu system.
- The user has the proper permissions to access that path.
Furthermore, when a menu is being rendered, paths that the current user does not have access to are not rendered in the menu.
The problem begins when the user creates a menu item using an absolute URL pointing to an internal system path. For example, with Clean URLs, the user could create a menu item using the path 'http://www.example.com/admin'.
This avoids all the access checks that are made when the path is entered as an internal path.
The other problem is that the site is no longer portable as links will break when migrated between Dev, Staging and Prod environments (or the domain is changed entirely).
This has happened on several client's sites when they add menu items by surfing to the page they want to add, copying the URL from the address bar, then pasting into the menu form.
Proposed solution
I would suggest that when the menu system parses absolute URLs, it should check:
- Does the domain in the URL match the domain of the site?
- If so, is the path in the Drupal menu system?
- Convert the absolute URL to a relative one.
- This shouldn't be necessary because core now treats the URL as relative.
I am putting this on my list of 'bugs to fix'. However, I can't guarantee I will get around to it soon. If someone wants to take a crack at it, please, take ownership and tackle it. Chances are you are more familiar with the menu system than I am anyways!