Browse Source

Move function & fix string

pull/691/head
danpros 1 year ago
parent
commit
18a6bc5cde
2 changed files with 19 additions and 19 deletions
  1. +16
    -0
      system/admin/admin.php
  2. +3
    -19
      system/includes/functions.php

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

@ -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 // Create Zip files
function Zip($source, $destination, $include_dir = false) function Zip($source, $destination, $include_dir = false)
{ {


+ 3
- 19
system/includes/functions.php View File

@ -2362,11 +2362,11 @@ function social($class = null)
} }
if (!empty($mastodon)) { if (!empty($mastodon)) {
$social .= '<a class="social-logo-mastodon" href="' . $mastodon . '" target="_blank"><span class="screen-reader-text">Instagram</span></a>';
$social .= '<a class="social-logo-mastodon" href="' . $mastodon . '" target="_blank"><span class="screen-reader-text">Mastodon</span></a>';
} }
if (!empty($tiktok)) { if (!empty($tiktok)) {
$social .= '<a class="social-logo-tiktok" href="' . $tiktok . '" target="_blank"><span class="screen-reader-text">Instagram</span></a>';
$social .= '<a class="social-logo-tiktok" href="' . $tiktok . '" target="_blank"><span class="screen-reader-text">TikTok</span></a>';
} }
$social .= '<a class="social-logo-feed" href="' . $rss . '" target="_blank"><span class="screen-reader-text">RSS</span></a>'; $social .= '<a class="social-logo-feed" href="' . $rss . '" target="_blank"><span class="screen-reader-text">RSS</span></a>';
@ -2822,7 +2822,7 @@ function not_found($request = null)
$filename = "content/data/views.json"; $filename = "content/data/views.json";
$views = array(); $views = array();
if (file_exists($filename)) { if (file_exists($filename)) {
$views = json_decode(file_get_contents($filename), true);
$views = json_decode(file_get_data($filename), true);
} }
if (isset($views[$request])) { if (isset($views[$request])) {
unset($views[$request]); unset($views[$request]);
@ -3544,22 +3544,6 @@ function safe_html($string)
return $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 // Replace href
function replace_href($string, $tag, $class, $url) function replace_href($string, $tag, $class, $url)
{ {


Loading…
Cancel
Save