We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 439c9f0 commit 85f8c0bCopy full SHA for 85f8c0b
src/class-endpoint-installer.php
@@ -87,20 +87,20 @@ public function install(): bool
87
88
$file_name = $this->get_file_name();
89
90
- // TODO: Verify contents? Or trust 200 OK response?
91
-
92
/* Attempt to put the file into place if it does not exist already */
93
if (! is_file($file_name)) {
94
- $success = file_put_contents($file_name, $this->get_file_contents());
95
- if (false === $success) {
+ $created = file_put_contents($file_name, $this->get_file_contents());
+ if (! $created) {
96
return false;
97
}
98
99
100
/* Send an HTTP request to the custom endpoint to see if it's working properly */
101
$works = self::verify();
102
if (! $works) {
103
- unlink($file_name);
+ if (isset($created) && $created) {
+ unlink($file_name);
+ }
104
105
106
0 commit comments