Skip to content

Commit

Permalink
Adds a check for the file is writable before saving it in Configurati…
Browse files Browse the repository at this point in the history
…onFile library.
  • Loading branch information
JB Lebrun committed Mar 5, 2020
1 parent eaf0b92 commit 35b19c4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Core/Libraries/Objects/ConfigurationFile.php.inc
Expand Up @@ -3,7 +3,7 @@
* @brief ConfigurationFile object.
* @details Engine / Object Library
* @author CaMykS Team <camyks.contact@gmail.com>
* @version 1.0.0
* @version 1.0.1
* @date Creation: Mar 2020
* @date Modification: Mar 2020
* @copyright 2020 CaMykS Team
Expand Down Expand Up @@ -119,6 +119,12 @@ final class ConfigurationFile {

/* Build file full path */
$file = new File($CaMykS->get_engineFileFullPath('Core/Configuration/'.$file.$CaMykS->libraryExtension), '', 'Write');

/* Check file is writable */
if ($file->is_writable() === false)
return false;

/* Write configuration */
return $file->write($content, true);
}

Expand Down

0 comments on commit 35b19c4

Please sign in to comment.