Browse Source

Add : colon to menu item links to fix external links (#6508)

demonspork 2 years ago
parent
commit
0c4b5e6f08
2 changed files with 2 additions and 2 deletions
  1. 1 1
      core/menu/menu_item_edit.php
  2. 1 1
      resources/classes/menu.php

+ 1 - 1
core/menu/menu_item_edit.php

@@ -91,7 +91,7 @@
 	}
 
 //sanitize the menu link
-	$menu_item_link = preg_replace('#[^a-zA-Z0-9_\-\.\&\=\?\/]#', '', $menu_item_link);
+	$menu_item_link = preg_replace('#[^a-zA-Z0-9_:\-\.\&\=\?\/]#', '', $menu_item_link);
 
 //when a HTTP POST is available then process it
 	if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {

+ 1 - 1
resources/classes/menu.php

@@ -421,7 +421,7 @@ if (!class_exists('menu')) {
 									$menu_item_description = $menu['desc'];
 
 								//sanitize the menu link
-									$menu_item_path = preg_replace('#[^a-zA-Z0-9_\-\.\&\=\?\/]#', '', $menu_item_path);
+									$menu_item_path = preg_replace('#[^a-zA-Z0-9_:\-\.\&\=\?\/]#', '', $menu_item_path);
 
 								//check if the menu item exists and if it does set the row array
 									$menu_item_exists = false;