← All changes
|
modules/optimization/classes/optimization-error-message.php
+2
-1
1.6.0
→
1.7.7
View file →
| @@ -20,9 +20,9 @@ | ||
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | public static function get_optimization_error_message( string $error_type ) { |
| 23 | 23 | if ( ! in_array( $error_type, Image_Optimization_Error_Type::get_values(), true ) ) { |
| 24 | - throw new TypeError( "Error type $error_type is not a part of Image_Optimization_Error_Type values" ); | |
| 24 | + throw new TypeError( esc_html( "Error type $error_type is not a part of Image_Optimization_Error_Type values" ) ); | |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | $messages = [ |
| 28 | 28 | Image_Optimization_Error_Type::FILE_ALREADY_EXISTS => esc_html__( 'File with this name already exists', 'image-optimization' ), |
| @@ -27,8 +27,9 @@ | ||
| 27 | 27 | $messages = [ |
| 28 | 28 | Image_Optimization_Error_Type::FILE_ALREADY_EXISTS => esc_html__( 'File with this name already exists', 'image-optimization' ), |
| 29 | 29 | Image_Optimization_Error_Type::QUOTA_EXCEEDED => esc_html__( 'Plan quota reached', 'image-optimization' ), |
| 30 | 30 | Image_Optimization_Error_Type::GENERIC => esc_html__( 'Optimization error', 'image-optimization' ), |
| 31 | + Image_Optimization_Error_Type::CONNECTION_ERROR => esc_html__( 'Connection error', 'image-optimization' ), | |
| 31 | 32 | ]; |
| 32 | 33 | |
| 33 | 34 | if ( isset( $messages[ $error_type ] ) ) { |
| 34 | 35 | return $messages[ $error_type ]; |