Browse Source

Bugs fixes.

Handle if magic quotes turned on, and fix archive sort on some linux
distros.
pull/31/merge
Danang Probo Sayekti 12 years ago
parent
commit
65a1d44370
6 changed files with 17 additions and 2 deletions
  1. +3
    -0
      admin/action/create_page.php
  2. +3
    -0
      admin/action/create_post.php
  3. +3
    -0
      admin/action/edit_bio.php
  4. +3
    -0
      admin/action/edit_page.php
  5. +3
    -0
      admin/action/edit_post.php
  6. +2
    -2
      system/includes/functions.php

+ 3
- 0
admin/action/create_page.php View File

@ -11,6 +11,9 @@
$post_content = $_POST['content']; $post_content = $_POST['content'];
} }
if(!empty($post_url) && !empty($post_content)) { if(!empty($post_url) && !empty($post_content)) {
if(get_magic_quotes_gpc()) {
$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)) {


+ 3
- 0
admin/action/create_post.php View File

@ -14,6 +14,9 @@
$post_content = $_POST['content']; $post_content = $_POST['content'];
} }
if(!empty($post_tag) && !empty($post_url) && !empty($post_content)) { if(!empty($post_tag) && !empty($post_url) && !empty($post_content)) {
if(get_magic_quotes_gpc()) {
$post_content = stripslashes($post_content);
}
$user = $_SESSION['user']; $user = $_SESSION['user'];
$filename = $post_date . '_' . $post_tag . '_' . $post_url . '.md'; $filename = $post_date . '_' . $post_tag . '_' . $post_url . '.md';
$dir = '../../content/' . $user. '/blog/'; $dir = '../../content/' . $user. '/blog/';


+ 3
- 0
admin/action/edit_bio.php View File

@ -18,6 +18,9 @@
$bio_content = $_POST['content']; $bio_content = $_POST['content'];
} }
if(!empty($bio_content)) { if(!empty($bio_content)) {
if(get_magic_quotes_gpc()) {
$bio_content = stripslashes($bio_content);
}
$dir = '../../content/' . $user. '/'; $dir = '../../content/' . $user. '/';
if(is_dir($dir)) { if(is_dir($dir)) {
file_put_contents($dir . $filename, print_r($bio_content, true)); file_put_contents($dir . $filename, print_r($bio_content, true));


+ 3
- 0
admin/action/edit_page.php View File

@ -22,6 +22,9 @@
$post_content = $_POST['content']; $post_content = $_POST['content'];
} }
if(!empty($post_content)) { if(!empty($post_content)) {
if(get_magic_quotes_gpc()) {
$post_content = stripslashes($post_content);
}
$newurl = $dir . '/' . $post_url . '.md'; $newurl = $dir . '/' . $post_url . '.md';
if($url === $newurl) { if($url === $newurl) {
file_put_contents($url, print_r($post_content, true)); file_put_contents($url, print_r($post_content, true));


+ 3
- 0
admin/action/edit_post.php View File

@ -28,6 +28,9 @@
$post_content = $_POST['content']; $post_content = $_POST['content'];
} }
if(!empty($post_content)) { if(!empty($post_content)) {
if(get_magic_quotes_gpc()) {
$post_content = stripslashes($post_content);
}
$newurl = $oldurl[0] . '_' . $post_tag . '_' . $post_url . '.md'; $newurl = $oldurl[0] . '_' . $post_tag . '_' . $post_url . '.md';
if($url === $newurl) { if($url === $newurl) {
file_put_contents($url, print_r($post_content, true)); file_put_contents($url, print_r($post_content, true));


+ 2
- 2
system/includes/functions.php View File

@ -530,9 +530,9 @@ function archive_list() {
echo '(' . count($months) . ')'; echo '(' . count($months) . ')';
echo '<ul class="month">'; echo '<ul class="month">';
# Sort the months
krsort($months);
$by_month = array_count_values($months); $by_month = array_count_values($months);
# Sort the months
krsort($by_month);
foreach ($by_month as $month => $count){ foreach ($by_month as $month => $count){
$name = date('F', mktime(0,0,0,$month,1,2010)); $name = date('F', mktime(0,0,0,$month,1,2010));
echo '<li class="item"><a href="' . site_url() . 'archive/' . $year . '-' . $month . '">' . $name . '</a>'; echo '<li class="item"><a href="' . site_url() . 'archive/' . $year . '-' . $month . '">' . $name . '</a>';


Loading…
Cancel
Save