Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ function update_config_from_post() {

}

//TODO: write to .ini file instead of .txt files
function save_config() {
// No sanitizing necessary. It's just being written to a text file, so no security hole really.
// We'll sanitize them when retrieving the config vars
Expand All @@ -142,9 +143,12 @@ function get_config() {
}
$this->config = array();
while ( ( $file = strtolower( readdir($dir) ) ) != false ) {
if ( '.txt' == substr($file,-4) ) {
$this->config[ substr($file, 0, -4) ] = file_get_contents( $this->config_dir . $file );
}
if ( '.ini' == substr($file,-4) ) {
$settings = parse_ini_file($this->config_dir.$file);
foreach ($settings as $name => $value) {
$this->config[$name] = $value;
}
}
}

//Todo: Sanitize config vars where necessary
Expand Down Expand Up @@ -190,4 +194,4 @@ function too_many_failures() {
}
return false;
}
}
}