Browse Source

Remove deprecated get_magic_quotes_gpc

PHP 8 compatibility
pull/405/merge v2.7.6
danpros 4 years ago
parent
commit
e722158f28
1 changed files with 25 additions and 30 deletions
  1. +25
    -30
      system/admin/admin.php

+ 25
- 30
system/admin/admin.php View File

@ -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 (!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'; $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 (!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)) { if(!empty($revertPost) || !empty($publishDraft)) {
@ -318,9 +314,9 @@ function add_page($title, $url, $content, $description = null)
$post_content = '<!--t ' . $post_title . ' t-->' . $post_description . "\n\n" . $content; $post_content = '<!--t ' . $post_title . ' t-->' . $post_description . "\n\n" . $content;
if (!empty($post_title) && !empty($post_url) && !empty($post_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'; $filename = $post_url . '.md';
$dir = 'content/static/'; $dir = 'content/static/';
if (is_dir($dir)) { if (is_dir($dir)) {
@ -352,9 +348,9 @@ function add_sub_page($title, $url, $content, $static, $description = null)
$post_content = '<!--t ' . $post_title . ' t-->' . $post_description . "\n\n" . $content; $post_content = '<!--t ' . $post_title . ' t-->' . $post_description . "\n\n" . $content;
if (!empty($post_title) && !empty($post_url) && !empty($post_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'; $filename = $post_url . '.md';
$dir = 'content/static/' . $static . '/'; $dir = 'content/static/' . $static . '/';
if (is_dir($dir)) { if (is_dir($dir)) {
@ -387,9 +383,9 @@ function edit_page($title, $url, $content, $oldfile, $destination = null, $descr
$post_content = '<!--t ' . $post_title . ' t-->' . $post_description . "\n\n" . $content; $post_content = '<!--t ' . $post_title . ' t-->' . $post_description . "\n\n" . $content;
if (!empty($post_title) && !empty($post_url) && !empty($post_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'; $newfile = $dir . '/' . $post_url . '.md';
if ($oldfile === $newfile) { if ($oldfile === $newfile) {
file_put_contents($oldfile, print_r($post_content, true)); file_put_contents($oldfile, print_r($post_content, true));
@ -437,9 +433,9 @@ function add_category($title, $url, $content, $description = null)
$post_content = '<!--t ' . $post_title . ' t-->' . $post_description . "\n\n" . $content; $post_content = '<!--t ' . $post_title . ' t-->' . $post_description . "\n\n" . $content;
if (!empty($post_title) && !empty($post_url) && !empty($post_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'; $filename = $post_url . '.md';
$dir = 'content/data/category/'; $dir = 'content/data/category/';
if (is_dir($dir)) { if (is_dir($dir)) {
@ -472,9 +468,8 @@ function edit_category($title, $url, $content, $oldfile, $destination = null, $d
$post_content = '<!--t ' . $post_title . ' t-->' . $post_description . "\n\n" . $content; $post_content = '<!--t ' . $post_title . ' t-->' . $post_description . "\n\n" . $content;
if (!empty($post_title) && !empty($post_url) && !empty($post_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'; $newfile = $dir . '/' . $post_url . '.md';
if ($oldfile === $newfile) { if ($oldfile === $newfile) {
file_put_contents($oldfile, print_r($post_content, true)); file_put_contents($oldfile, print_r($post_content, true));
@ -502,9 +497,9 @@ function edit_profile($title, $content, $user)
$user_content = '<!--t ' . $user_title . ' t-->' . "\n\n" . $content; $user_content = '<!--t ' . $user_title . ' t-->' . "\n\n" . $content;
if (!empty($user_title) && !empty($user_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 . '/'; $dir = 'content/' . $user . '/';
$filename = 'content/' . $user . '/author.md'; $filename = 'content/' . $user . '/author.md';
if (is_dir($dir)) { if (is_dir($dir)) {
@ -526,9 +521,9 @@ function edit_frontpage($title, $content)
$front_content = '<!--t ' . $front_title . ' t-->' . "\n\n" . $content; $front_content = '<!--t ' . $front_title . ' t-->' . "\n\n" . $content;
if (!empty($front_title) && !empty($front_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'; $dir = 'content/data/frontpage';
$filename = 'content/data/frontpage/frontpage.md'; $filename = 'content/data/frontpage/frontpage.md';
if (is_dir($dir)) { if (is_dir($dir)) {
@ -617,9 +612,9 @@ function migrate($title, $time, $tags, $content, $url, $user, $source)
$post_content = '<!--t ' . $post_title . ' t-->' . "\n" . '<!--tag' . $post_tagmd . 'tag-->' . "\n\n" . $content; $post_content = '<!--t ' . $post_title . ' t-->' . "\n" . '<!--tag' . $post_tagmd . 'tag-->' . "\n\n" . $content;
} }
if (!empty($post_title) && !empty($post_tag) && !empty($post_url) && !empty($post_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'; $filename = $post_date . '_' . $post_tag . '_' . $post_url . '.md';
$dir = 'content/' . $user . '/blog/uncategorized/post/'; $dir = 'content/' . $user . '/blog/uncategorized/post/';
if (is_dir($dir)) { if (is_dir($dir)) {


Loading…
Cancel
Save