Переглянути джерело

Sanitize the menu link by restricting it to specific characters.

FusionPBX 3 роки тому
батько
коміт
4851054855
1 змінених файлів з 4 додано та 1 видалено
  1. 4 1
      resources/classes/menu.php

+ 4 - 1
resources/classes/menu.php

@@ -17,7 +17,7 @@
 
 
 	The Initial Developer of the Original Code is
 	The Initial Developer of the Original Code is
 	Mark J Crane <[email protected]>
 	Mark J Crane <[email protected]>
-	Copyright (C) 2010 - 2020
+	Copyright (C) 2010 - 2022
 	All Rights Reserved.
 	All Rights Reserved.
 
 
 	Contributor(s):
 	Contributor(s):
@@ -420,6 +420,9 @@ if (!class_exists('menu')) {
 									$menu_item_order = $menu['order'];
 									$menu_item_order = $menu['order'];
 									$menu_item_description = $menu['desc'];
 									$menu_item_description = $menu['desc'];
 
 
+								//sanitize the menu link
+									$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
 								//check if the menu item exists and if it does set the row array
 									$menu_item_exists = false;
 									$menu_item_exists = false;
 									foreach ($menu_items as $item) {
 									foreach ($menu_items as $item) {