Skip to content

Commit

Permalink
Remove deprecated magic quote handling
Browse files Browse the repository at this point in the history
  • Loading branch information
pinknet committed Jan 24, 2024
1 parent 82f0e78 commit 3c23592
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -572,15 +572,7 @@ private function saveFile($d) {

if (isset($d['filename']) && $this->isFilenameValid($d['filename'])) {
if (isset($d['content'])) {
// work around magic quotes
if ((function_exists("get_magic_quotes_gpc") && get_magic_quotes_gpc())
|| (ini_get('magic_quotes_sybase') && (strtolower(ini_get('magic_quotes_sybase'))!="off")) ) {
$content = stripslashes($d['content']);
} else {
$content = $d['content'];
}

if (@file_put_contents($d['filename'], $content) !== false)
if (@file_put_contents($d['filename'], $d['content']) !== false)
return ["status" => "OK", "message" => $this->l('file_save_success')];
else
throw new Exception($this->l('file_save_error'));
Expand Down

0 comments on commit 3c23592

Please sign in to comment.