| @@ -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 | } |