Skip to content

Commit

Permalink
My bad
Browse files Browse the repository at this point in the history
  • Loading branch information
danpros committed Nov 27, 2023
1 parent 3278f6e commit 9b162c2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
14 changes: 6 additions & 8 deletions system/admin/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,10 @@ function add_content($title, $tag, $url, $content, $user, $draft, $category, $ty

$post_date = date('Y-m-d-H-i-s');
$post_title = safe_html($title);
if (defined('PHP_MAJOR_VERSION') && PHP_MAJOR_VERSION < 7) {
$post_media = preg_replace('/\s\s+/', ' ', strip_tags($media));
} else {
$post_media = preg_replace('/\s\s+/', ' ', strip_tags($media ?? ''));
if (is_null($media)) {
$media = '';
}
$post_media = preg_replace('/\s\s+/', ' ', strip_tags($media));
$post_tag = strtolower(preg_replace(array('/[^a-zA-Z0-9,. \-\p{L}]/u', '/[ -]+/', '/^-|-$/'), array('', '-', ''), remove_accent($post_tag)));
$post_url = strtolower(preg_replace(array('/[^a-zA-Z0-9 \-\p{L}]/u', '/[ -]+/', '/^-|-$/'), array('', '-', ''), remove_accent($url)));
$description = safe_html($description);
Expand Down Expand Up @@ -264,11 +263,10 @@ function edit_content($title, $tag, $url, $content, $oldfile, $revertPost, $publ
}

$post_title = safe_html($title);
if (defined('PHP_MAJOR_VERSION') && PHP_MAJOR_VERSION < 7) {
$post_media = preg_replace('/\s\s+/', ' ', strip_tags($media));
} else {
$post_media = preg_replace('/\s\s+/', ' ', strip_tags($media ?? ''));
if (is_null($media)) {
$media = '';
}
$post_media = preg_replace('/\s\s+/', ' ', strip_tags($media));
$post_tag = strtolower(preg_replace(array('/[^a-zA-Z0-9,. \-\p{L}]/u', '/[ -]+/', '/^-|-$/'), array('', '-', ''), remove_accent($post_tag)));
$post_url = strtolower(preg_replace(array('/[^a-zA-Z0-9 \-\p{L}]/u', '/[ -]+/', '/^-|-$/'), array('', '-', ''), remove_accent($url)));
$description = safe_html($description);
Expand Down
15 changes: 6 additions & 9 deletions system/includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ function get_category($category, $page, $perpage, $random)

// Return category info.
function get_category_info($category)
{
{
$posts = get_category_files();

$tmp = array();
Expand Down Expand Up @@ -570,14 +570,11 @@ function get_category_info($category)
}
}

if (defined('PHP_MAJOR_VERSION') && PHP_MAJOR_VERSION < 7) {
if (strtolower($category) == 'uncategorized') {
return default_category();
}
} else {
if (strtolower($category ?? '') == 'uncategorized') {
return default_category();
}
if (is_null($category)) {
$category = '';
}
if (strtolower($category) == 'uncategorized') {
return default_category();
}

return $tmp;
Expand Down

2 comments on commit 9b162c2

@vdbhb59
Copy link
Contributor

@vdbhb59 vdbhb59 commented on 9b162c2 Nov 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How to update to this? Should I manually make the code changes, cause inbuilt updater does not reflect the changes you made today.
In your reply, kindly tag me as I for some reason never get any notifications.

@danpros
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello,

If your PHP is not 5.x you can ignore it, this is just backward compatibility with PHP 5.x. Previously I must delete and create release using the same tags because of short timespan if creating new tags for it.

Please sign in to comment.