File cleanup in progress

This commit is contained in:
Michał Gdula 2022-08-01 10:31:23 +01:00
parent b58588fe85
commit 47aa830771
8 changed files with 202 additions and 117 deletions

View file

@ -13,9 +13,6 @@
<?php
include("ui/header.php");
// Include flyout for extra actions
include("ui/flyout.php");
// Deletion toast
if ($_GET["del"] == "true") {
echo "<p class='alert alert-high space-bottom'>Successfully deleted image: ".$_GET['id']."</p>";
@ -44,18 +41,6 @@
// Unset all the variables, needed by flyout
unset($header, $content, $action);
// Clean tags before adding
function clean($string) {
// Change to lowercase
$string = strtolower($string);
// Replace hyphens
$string = str_replace('-', '_', $string);
// Regex
$string = preg_replace('/[^A-Za-z0-9\_ ]/', '', $string);
// Return string
return preg_replace('/ +/', ' ', $string);
}
// Clean input
$tags_string = clean(trim($_POST['search']));