File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -87,20 +87,20 @@ public function install(): bool
87
87
88
88
$ file_name = $ this ->get_file_name ();
89
89
90
- // TODO: Verify contents? Or trust 200 OK response?
91
-
92
90
/* Attempt to put the file into place if it does not exist already */
93
91
if (! is_file ($ file_name )) {
94
- $ success = file_put_contents ($ file_name , $ this ->get_file_contents ());
95
- if (false === $ success ) {
92
+ $ created = file_put_contents ($ file_name , $ this ->get_file_contents ());
93
+ if (! $ created ) {
96
94
return false ;
97
95
}
98
96
}
99
97
100
98
/* Send an HTTP request to the custom endpoint to see if it's working properly */
101
99
$ works = self ::verify ();
102
100
if (! $ works ) {
103
- unlink ($ file_name );
101
+ if (isset ($ created ) && $ created ) {
102
+ unlink ($ file_name );
103
+ }
104
104
return false ;
105
105
}
106
106
You can’t perform that action at this time.
0 commit comments