monstra-cms / monstra

THIS PROJECT IS NOT SUPPORTED ANYMORE! Check FLEXTYPE.ORG
http://flextype.org
MIT License
396 stars 123 forks source link

Cannot use absolute https links in menu #419

Open ghost opened 8 years ago

ghost commented 8 years ago

When adding a new menu item that is a https link, for example https://www.google.com, the menu plugin doesn't parse it correctly and add's the siteurl at the start.

I suggest the following change to plugins/box/menu/views/frontend/index.view.php:

//            $pos = strpos($item['link'], 'http://');
//            if ($pos === false) {
//                $link = Option::get('siteurl').'/'.$item['link'];
//            } else {
//                $link = $item['link'];
//         Check for http or https in link:
            if ( strpos($item['link'], 'http://') == 0 || strpos($item['link'], 'https://') == 0 ) {
                $link = $item['link'];
            } else {
                $link = Option::get('siteurl').'/'.$item['link'];
            }