PluginProbe
Image Optimizer – Compress Images and Convert to WebP or AVIF / 1.7.7
Image Optimizer – Compress Images and Convert to WebP or AVIF v1.7.7
1.7.7 1.7.6 1.7.5 1.7.4 trunk 1.0.0 1.0.1 1.0.2 1.1.0 1.2.0 1.2.1 1.3.0 1.4.0 1.4.1 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 All 33 releases
← All changes | classes/file-system/file-system.php +5 -5 1.6.01.7.7 View file →
@@ -31,9 +31,9 @@
31 31
32 32 $result = $wp_filesystem->put_contents( $file, $contents, $mode );
33 33
34 34 if ( ! $result ) {
35 - throw new File_System_Operation_Error( 'Error while writing ' . $file );
35 + throw new File_System_Operation_Error( esc_html( "Error while writing $file" ) );
36 36 }
37 37
38 38 return true;
39 39 }
@@ -54,9 +54,9 @@
54 54
55 55 $result = $wp_filesystem->delete( $file, $recursive, $type );
56 56
57 57 if ( ! $result ) {
58 - throw new File_System_Operation_Error( 'Error while deleting ' . $file );
58 + throw new File_System_Operation_Error( esc_html( "Error while deleting $file" ) );
59 59 }
60 60
61 61 return true;
62 62 }
@@ -75,9 +75,9 @@
75 75
76 76 $result = $wp_filesystem->move( $source, $destination, $overwrite );
77 77
78 78 if ( ! $result ) {
79 - throw new File_System_Operation_Error( "Error while moving {$source} to {$destination}" );
79 + throw new File_System_Operation_Error( esc_html( "Error while moving $source to $destination" ) );
80 80 }
81 81
82 82 return true;
83 83 }
@@ -99,9 +99,9 @@
99 99
100 100 $result = $wp_filesystem->copy( $source, $destination, $overwrite, $mode );
101 101
102 102 if ( ! $result ) {
103 - throw new File_System_Operation_Error( "Error while copying {$source} to {$destination}" );
103 + throw new File_System_Operation_Error( esc_html( "Error while copying $source to $destination" ) );
104 104 }
105 105
106 106 return true;
107 107 }
@@ -137,9 +137,9 @@
137 137
138 138 $size = $wp_filesystem->size( $path );
139 139
140 140 if ( ! $size ) {
141 - throw new File_System_Operation_Error( "Unable to calculate file size for $path" );
141 + throw new File_System_Operation_Error( esc_html( "Unable to calculate file size for $path" ) );
142 142 }
143 143
144 144 return $size;
145 145 }