From 18a6bc5cde5daf1835bda86bfa795dbd3f4f77e5 Mon Sep 17 00:00:00 2001 From: danpros Date: Tue, 27 Feb 2024 10:56:38 +0700 Subject: [PATCH] Move function & fix string --- system/admin/admin.php | 16 ++++++++++++++++ system/includes/functions.php | 22 +++------------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/system/admin/admin.php b/system/admin/admin.php index 7fa1bfb..38e7f13 100644 --- a/system/admin/admin.php +++ b/system/admin/admin.php @@ -1269,6 +1269,22 @@ function get_feed($feed_url, $credit) } } +// return tag safe string +function safe_tag($string) +{ + $tags = array(); + $string = preg_replace('/[\s-]+/', ' ', $string); + $string = explode(',', $string); + $string = array_map('trim', $string); + foreach ($string as $str) { + $tags[] = $str; + } + $string = implode(',', $tags); + $string = preg_replace('/[\s_]/', '-', $string); + return $string; + +} + // Create Zip files function Zip($source, $destination, $include_dir = false) { diff --git a/system/includes/functions.php b/system/includes/functions.php index ed1d254..eb6768d 100644 --- a/system/includes/functions.php +++ b/system/includes/functions.php @@ -2362,11 +2362,11 @@ function social($class = null) } if (!empty($mastodon)) { - $social .= 'Instagram'; + $social .= 'Mastodon'; } if (!empty($tiktok)) { - $social .= 'Instagram'; + $social .= 'TikTok'; } $social .= 'RSS'; @@ -2822,7 +2822,7 @@ function not_found($request = null) $filename = "content/data/views.json"; $views = array(); if (file_exists($filename)) { - $views = json_decode(file_get_contents($filename), true); + $views = json_decode(file_get_data($filename), true); } if (isset($views[$request])) { unset($views[$request]); @@ -3544,22 +3544,6 @@ function safe_html($string) return $string; } -// return tag safe string -function safe_tag($string) -{ - $tags = array(); - $string = preg_replace('/[\s-]+/', ' ', $string); - $string = explode(',', $string); - $string = array_map('trim', $string); - foreach ($string as $str) { - $tags[] = $str; - } - $string = implode(',', $tags); - $string = preg_replace('/[\s_]/', '-', $string); - return $string; - -} - // Replace href function replace_href($string, $tag, $class, $url) {