diff --git a/admin/action/create_page.php b/admin/action/create_page.php
index f9d7bda..dabd686 100644
--- a/admin/action/create_page.php
+++ b/admin/action/create_page.php
@@ -6,11 +6,12 @@
include '../includes/session.php';
if(isset($_POST['submit'])) {
+ $post_title = $_POST['title'];
$post_url = preg_replace('/[^A-Za-z0-9,.-]/u', '', $_POST['url']);
$post_url = rtrim($post_url, ',\.\-');
- $post_content = $_POST['content'];
+ $post_content = '' . "\n\n" . $_POST['content'];
}
- if(!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);
}
@@ -53,6 +54,7 @@
diff --git a/admin/action/edit_page.php b/admin/action/edit_page.php
index e1a1e23..4145bc7 100644
--- a/admin/action/edit_page.php
+++ b/admin/action/edit_page.php
@@ -12,16 +12,28 @@
header('location: ../index.php');
}
+ $content = file_get_contents($url);
+ $arr = explode('t-->', $content);
+ if(isset($arr[1])) {
+ $oldtitle = ltrim(rtrim(str_replace('' . "\n\n" . $_POST['content'];
}
- if(!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);
}
@@ -65,9 +77,10 @@
diff --git a/admin/action/edit_post.php b/admin/action/edit_post.php
index 7874b7d..812121a 100644
--- a/admin/action/edit_post.php
+++ b/admin/action/edit_post.php
@@ -12,6 +12,17 @@
header('location: ../index.php');
}
+ $content = file_get_contents($url);
+ $arr = explode('t-->', $content);
+ if(isset($arr[1])) {
+ $oldtitle = ltrim(rtrim(str_replace('' . "\n\n" . $_POST['content'];
}
- if(!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);
}
@@ -71,10 +83,11 @@
diff --git a/system/includes/functions.php b/system/includes/functions.php
index 3f348b5..829569e 100644
--- a/system/includes/functions.php
+++ b/system/includes/functions.php
@@ -156,13 +156,13 @@ function get_posts($posts, $page = 1, $perpage = 0){
$content = MarkdownExtra::defaultTransform(file_get_contents($filepath));
// Extract the title and body
- $arr = explode('', $content);
+ $arr = explode('t-->', $content);
if(isset($arr[1])) {
- $post->title = str_replace('','',$arr[0]);
+ $post->title = str_replace('', $content);
if(isset($arr[1])) {
- $post->title = str_replace('','',$arr[0]);
+ $post->title = str_replace('', $content);
if(isset($arr[1])) {
- $post->title = str_replace('','',$arr[0]);
+ $post->title = str_replace('', $content);
if(isset($arr[1])) {
- $post->title = str_replace('','',$arr[0]);
+ $post->title = str_replace('