File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -702,11 +702,14 @@ private function writeConfig() : void {
702702 // original config is never touched until the new content is fully on disk.
703703 $ tempFile = DataConst::GetConfigFile () . '.tmp ' ;
704704 if (file_put_contents ($ tempFile , $ content ) === false ) {
705- @unlink ($ tempFile );
705+ // The file probably wasn't created, but better check nonetheless.
706+ if (file_exists ($ tempFile )) {
707+ unlink ($ tempFile );
708+ }
706709 throw new InvalidSettingConfigurationException ("Failed to write temporary config file: " . $ tempFile );
707710 }
708711 if (!rename ($ tempFile , DataConst::GetConfigFile ())) {
709- @ unlink ($ tempFile );
712+ unlink ($ tempFile );
710713 throw new InvalidSettingConfigurationException ("Failed to rename " . $ tempFile . " to " . DataConst::GetConfigFile ());
711714 }
712715 $ this ->config = [];
You can’t perform that action at this time.
0 commit comments