PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / trunk
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance vtrunk
4.7.0 4.6.1 4.6.0 4.5.5 4.5.4 4.5.3 4.5.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.5 3.2.6 3.2.7 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.7.0 3.7.1 All 111 releases
← All changes | vendor/rosell-dk/webp-convert/src/Convert/Converters/BaseTraits/DestinationPreparationTrait.php +5 -5 3.3.2 → trunk View file →
@@ -68,12 +68,12 @@
68 68 // The above might fail on Windows, even though dir is writable
69 69 // So, to be absolute sure that we cannot write, we make an actual write test (writing a dummy file)
70 70 // No harm in doing that for non-Windows systems either.
71 71 if (file_put_contents($destination, 'dummy') !== false) {
72 - if (file_exists($destination)) {
73 - // all is well, after all
74 - unlink($destination);
75 - }
72 + if (file_exists($destination)) {
73 + // all is well, after all
74 + unlink($destination);
75 + }
76 76 return;
77 77 }
78 78
79 79 throw new CreateDestinationFileException(
@@ -92,9 +92,9 @@
92 92 $destination = $this->getDestination();
93 93 if (file_exists($destination)) {
94 94 // A file already exists in this folder...
95 95 // We delete it, to make way for a new webp
96 - if (!unlink($destination)) {
96 + if (!@unlink($destination)) {
97 97 throw new CreateDestinationFileException(
98 98 'Existing file cannot be removed: ' . basename($destination)
99 99 );
100 100 }