| @@ -1,29 +1,17 @@ | ||
| 1 | 1 | <?php |
| 2 | +namespace MaxButtons; | |
| 2 | 3 | defined('ABSPATH') or die('No direct access permitted'); |
| 3 | 4 | |
| 4 | 5 | if (isset($_GET['action']) && $_GET['action'] != '') { |
| 5 | - switch ($_GET['action']) { | |
| 6 | + // extra safety. | |
| 7 | + $action = sanitize_text_field($_GET['action']); | |
| 8 | + | |
| 9 | + switch ($action) { | |
| 6 | 10 | case 'button': |
| 7 | 11 | case 'edit': |
| 8 | - if (isset($_GET["popup"]) && $_GET["popup"] == true) // bugs with save function to name something | |
| 9 | - include_once 'button_editor_popup.php'; | |
| 10 | - else | |
| 11 | 12 | include_once 'maxbuttons-button.php'; |
| 12 | - break; | |
| 13 | - case 'copy': | |
| 14 | - include_once 'maxbuttons-copy.php'; | |
| 15 | - break; | |
| 16 | - case 'delete': | |
| 17 | - include_once 'maxbuttons-delete.php'; | |
| 18 | - break; | |
| 19 | - case 'trash': | |
| 20 | - include_once 'maxbuttons-trash.php'; | |
| 21 | - break; | |
| 22 | - case 'restore': | |
| 23 | - include_once 'maxbuttons-restore.php'; | |
| 24 | - break; | |
| 25 | - | |
| 13 | + break; | |
| 26 | 14 | default: |
| 27 | 15 | include_once 'maxbuttons-list.php'; |
| 28 | 16 | break; |
| 29 | 17 | } |