Pārlūkot izejas kodu

Sanitize the menu link by restricting it to specific characters.

FusionPBX 3 gadi atpakaļ
vecāks
revīzija
bfb15ae036
1 mainītis faili ar 5 papildinājumiem un 2 dzēšanām
  1. 5 2
      core/menu/menu_item_edit.php

+ 5 - 2
core/menu/menu_item_edit.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]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2019
+	Portions created by the Initial Developer are Copyright (C) 2008-2022
 	the Initial Developer. All Rights Reserved.
 	the Initial Developer. All Rights Reserved.
 
 
 	Contributor(s):
 	Contributor(s):
@@ -87,6 +87,9 @@
 		$menu_item_order = $_POST["menu_item_order"];
 		$menu_item_order = $_POST["menu_item_order"];
 	}
 	}
 
 
+//sanitize the menu link
+	$menu_item_link = preg_replace('#[^a-zA-Z0-9_\-\.\&\=\?\/]#', '', $menu_item_link);
+
 //when a HTTP POST is available then process it
 //when a HTTP POST is available then process it
 	if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
 	if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
 
 
@@ -561,4 +564,4 @@
 //include the footer
 //include the footer
   require_once "resources/footer.php";
   require_once "resources/footer.php";
 
 
-?>
+?>