diff --git a/system/admin/admin.php b/system/admin/admin.php index 5e7e13c..3fc4f80 100644 --- a/system/admin/admin.php +++ b/system/admin/admin.php @@ -114,9 +114,7 @@ function add_content($title, $tag, $url, $content, $user, $description = null, $ if (!empty($post_title) && !empty($post_tag) && !empty($post_url) && !empty($post_content)) { - if (get_magic_quotes_gpc()) { - $post_content = stripslashes($post_content); - } + $post_content = stripslashes($post_content); $filename = $post_date . '_' . $post_tag . '_' . $post_url . '.md'; @@ -187,9 +185,7 @@ function edit_content($title, $tag, $url, $content, $oldfile, $destination = nul if (!empty($post_title) && !empty($post_tag) && !empty($post_url) && !empty($post_content)) { - if (get_magic_quotes_gpc()) { - $post_content = stripslashes($post_content); - } + $post_content = stripslashes($post_content); if(!empty($revertPost) || !empty($publishDraft)) { @@ -318,9 +314,9 @@ function add_page($title, $url, $content, $description = null) $post_content = '' . $post_description . "\n\n" . $content; if (!empty($post_title) && !empty($post_url) && !empty($post_content)) { - if (get_magic_quotes_gpc()) { - $post_content = stripslashes($post_content); - } + + $post_content = stripslashes($post_content); + $filename = $post_url . '.md'; $dir = 'content/static/'; if (is_dir($dir)) { @@ -352,9 +348,9 @@ function add_sub_page($title, $url, $content, $static, $description = null) $post_content = '' . $post_description . "\n\n" . $content; if (!empty($post_title) && !empty($post_url) && !empty($post_content)) { - if (get_magic_quotes_gpc()) { - $post_content = stripslashes($post_content); - } + + $post_content = stripslashes($post_content); + $filename = $post_url . '.md'; $dir = 'content/static/' . $static . '/'; if (is_dir($dir)) { @@ -387,9 +383,9 @@ function edit_page($title, $url, $content, $oldfile, $destination = null, $descr $post_content = '' . $post_description . "\n\n" . $content; if (!empty($post_title) && !empty($post_url) && !empty($post_content)) { - if (get_magic_quotes_gpc()) { - $post_content = stripslashes($post_content); - } + + $post_content = stripslashes($post_content); + $newfile = $dir . '/' . $post_url . '.md'; if ($oldfile === $newfile) { file_put_contents($oldfile, print_r($post_content, true)); @@ -437,9 +433,9 @@ function add_category($title, $url, $content, $description = null) $post_content = '' . $post_description . "\n\n" . $content; if (!empty($post_title) && !empty($post_url) && !empty($post_content)) { - if (get_magic_quotes_gpc()) { - $post_content = stripslashes($post_content); - } + + $post_content = stripslashes($post_content); + $filename = $post_url . '.md'; $dir = 'content/data/category/'; if (is_dir($dir)) { @@ -472,9 +468,8 @@ function edit_category($title, $url, $content, $oldfile, $destination = null, $d $post_content = '' . $post_description . "\n\n" . $content; if (!empty($post_title) && !empty($post_url) && !empty($post_content)) { - if (get_magic_quotes_gpc()) { - $post_content = stripslashes($post_content); - } + $post_content = stripslashes($post_content); + $newfile = $dir . '/' . $post_url . '.md'; if ($oldfile === $newfile) { file_put_contents($oldfile, print_r($post_content, true)); @@ -502,9 +497,9 @@ function edit_profile($title, $content, $user) $user_content = '' . "\n\n" . $content; if (!empty($user_title) && !empty($user_content)) { - if (get_magic_quotes_gpc()) { - $user_content = stripslashes($user_content); - } + + $user_content = stripslashes($user_content); + $dir = 'content/' . $user . '/'; $filename = 'content/' . $user . '/author.md'; if (is_dir($dir)) { @@ -526,9 +521,9 @@ function edit_frontpage($title, $content) $front_content = '' . "\n\n" . $content; if (!empty($front_title) && !empty($front_content)) { - if (get_magic_quotes_gpc()) { - $front_content = stripslashes($front_content); - } + + $front_content = stripslashes($front_content); + $dir = 'content/data/frontpage'; $filename = 'content/data/frontpage/frontpage.md'; if (is_dir($dir)) { @@ -617,9 +612,9 @@ function migrate($title, $time, $tags, $content, $url, $user, $source) $post_content = '' . "\n" . '' . "\n\n" . $content; } if (!empty($post_title) && !empty($post_tag) && !empty($post_url) && !empty($post_content)) { - if (get_magic_quotes_gpc()) { - $post_content = stripslashes($post_content); - } + + $post_content = stripslashes($post_content); + $filename = $post_date . '_' . $post_tag . '_' . $post_url . '.md'; $dir = 'content/' . $user . '/blog/uncategorized/post/'; if (is_dir($dir)) {