| @@ -86,9 +86,9 @@ | ||
| 86 | 86 | ) |
| 87 | 87 | ); |
| 88 | 88 | |
| 89 | 89 | if (is_wp_error($plugin_information)) { |
| 90 | - throw new \Exception($plugin_information->get_error_message()); | |
| 90 | + throw new \Exception(esc_html($plugin_information->get_error_message())); | |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | $package = $plugin_information->download_link; |
| 94 | 94 | $download = $upgrader->download_package($package); |
| @@ -93,15 +93,15 @@ | ||
| 93 | 93 | $package = $plugin_information->download_link; |
| 94 | 94 | $download = $upgrader->download_package($package); |
| 95 | 95 | |
| 96 | 96 | if (is_wp_error($download)) { |
| 97 | - throw new \Exception($download->get_error_message()); | |
| 97 | + throw new \Exception(esc_html($download->get_error_message())); | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | $working_dir = $upgrader->unpack_package($download, true); |
| 101 | 101 | |
| 102 | 102 | if (is_wp_error($working_dir)) { |
| 103 | - throw new \Exception($working_dir->get_error_message()); | |
| 103 | + throw new \Exception(esc_html($working_dir->get_error_message())); | |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | $result = $upgrader->install_package( |
| 107 | 107 | array( |
| @@ -117,9 +117,9 @@ | ||
| 117 | 117 | ) |
| 118 | 118 | ); |
| 119 | 119 | |
| 120 | 120 | if (is_wp_error($result)) { |
| 121 | - throw new \Exception($result->get_error_message()); | |
| 121 | + throw new \Exception(esc_html($result->get_error_message())); | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | $activate = true; |
| 125 | 125 | |
| @@ -137,9 +137,9 @@ | ||
| 137 | 137 | try { |
| 138 | 138 | $result = activate_plugin($installed ? $installed_plugins[$plugin_file] : $plugin_slug . '/' . $plugin_file); |
| 139 | 139 | |
| 140 | 140 | if (is_wp_error($result)) { |
| 141 | - throw new \Exception($result->get_error_message()); | |
| 141 | + throw new \Exception(esc_html($result->get_error_message())); | |
| 142 | 142 | } |
| 143 | 143 | } catch (\Exception $e) { |
| 144 | 144 | } |
| 145 | 145 | } |