Browse Source

Remove the stripslashes()

See  #564
pull/663/head
danpros 2 years ago
parent
commit
829d3d740d
2 changed files with 1 additions and 21 deletions
  1. +1
    -1
      README.md
  2. +0
    -20
      system/admin/admin.php

+ 1
- 1
README.md View File

@ -185,7 +185,7 @@ When you write a blog post and save it via the admin panel, HTMLy automatically
Here's the explanation (separated by an underscore): Here's the explanation (separated by an underscore):
- `2014-01-31-12-56-40` is the published date. The date format is `yyyy-mm-dd-hh-mm-ss`
- `2014-01-31-12-56-40` is the published date. The date format is `Y-m-d-H-i-s`
- `tag1,tag2,tag3` are the tags, separated by commas - `tag1,tag2,tag3` are the tags, separated by commas
- `databaseless-blogging-platform-flat-file-blog` is the URL - `databaseless-blogging-platform-flat-file-blog` is the URL


+ 0
- 20
system/admin/admin.php View File

@ -184,8 +184,6 @@ function add_content($title, $tag, $url, $content, $user, $draft, $category, $ty
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)) {
$post_content = stripslashes($post_content);
$filename = $post_date . '_' . $post_tag . '_' . $post_url . '.md'; $filename = $post_date . '_' . $post_tag . '_' . $post_url . '.md';
if (empty($draft)) { if (empty($draft)) {
@ -344,8 +342,6 @@ function edit_content($title, $tag, $url, $content, $oldfile, $revertPost, $publ
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)) {
$post_content = stripslashes($post_content);
if(!empty($revertPost) || !empty($publishDraft)) { if(!empty($revertPost) || !empty($publishDraft)) {
if($dir[4] == 'draft') { if($dir[4] == 'draft') {
@ -499,8 +495,6 @@ function add_page($title, $url, $content, $description = null)
if (!empty($post_title) && !empty($post_url) && !empty($post_content)) { if (!empty($post_title) && !empty($post_url) && !empty($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)) {
@ -537,8 +531,6 @@ function add_sub_page($title, $url, $content, $static, $description = null)
if (!empty($post_title) && !empty($post_url) && !empty($post_content)) { if (!empty($post_title) && !empty($post_url) && !empty($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)) {
@ -578,8 +570,6 @@ function edit_page($title, $url, $content, $oldfile, $destination = null, $descr
if (!empty($post_title) && !empty($post_url) && !empty($post_content)) { if (!empty($post_title) && !empty($post_url) && !empty($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));
@ -641,8 +631,6 @@ function add_category($title, $url, $content, $description = null)
if (!empty($post_title) && !empty($post_url) && !empty($post_content)) { if (!empty($post_title) && !empty($post_url) && !empty($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)) {
@ -679,8 +667,6 @@ 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)) {
$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));
@ -709,8 +695,6 @@ function edit_profile($title, $content, $user)
if (!empty($user_title) && !empty($user_content)) { if (!empty($user_title) && !empty($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)) {
@ -733,8 +717,6 @@ function edit_frontpage($title, $content)
if (!empty($front_title) && !empty($front_content)) { if (!empty($front_title) && !empty($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)) {
@ -824,8 +806,6 @@ function migrate($title, $time, $tags, $content, $url, $user, $source)
} }
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)) {
$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