| @@ -68,10 +68,10 @@ | ||
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | $this->raise_limits(); |
| 71 | 71 | |
| 72 | - $plugin_slug = (isset($_POST['slug'])) ? sanitize_text_field( $_POST['slug'] ) : ''; | |
| 73 | - $plugin_file = (isset($_POST['file'])) ? sanitize_file_name( $_POST['file'] ) : ''; | |
| 72 | + $plugin_slug = (isset($_POST['slug'])) ? sanitize_text_field( wp_unslash( $_POST['slug'] ) ) : ''; | |
| 73 | + $plugin_file = (isset($_POST['file'])) ? sanitize_file_name( wp_unslash( $_POST['file'] ) ) : ''; | |
| 74 | 74 | |
| 75 | 75 | if (empty($plugin_file) || empty($plugin_slug)) { |
| 76 | 76 | wp_send_json_error(__('You don\'t have set any slug and file name to install the plugins', 'notificationx')); |
| 77 | 77 | } |
| @@ -123,9 +123,13 @@ | ||
| 123 | 123 | */ |
| 124 | 124 | public function raise_limits() { |
| 125 | 125 | wp_raise_memory_limit('admin'); |
| 126 | 126 | if (wp_is_ini_value_changeable('max_execution_time')) { |
| 127 | + // Downloading and unpacking the free plugin can exceed the default limit. | |
| 128 | + // phpcs:ignore Squiz.PHP.DiscouragedFunctions.Discouraged | |
| 127 | 129 | ini_set('max_execution_time', 0); |
| 128 | 130 | } |
| 131 | + // Downloading and unpacking the free plugin can exceed the default limit. | |
| 132 | + // phpcs:ignore Squiz.PHP.DiscouragedFunctions.Discouraged | |
| 129 | 133 | @set_time_limit(0); |
| 130 | 134 | } |
| 131 | 135 | } |