mirror of
https://github.com/Fluffy-Bean/image-gallery.git
synced 2025-06-21 17:26:18 +00:00
File cleanup in progress
This commit is contained in:
parent
b58588fe85
commit
47aa830771
8 changed files with 202 additions and 117 deletions
15
index.php
15
index.php
|
@ -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']));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue