Pith - miter
miter/back/admin/icons_delete.php [0.7 kb]
Modified: 17:48:38 114 026 (11 Jul 026)
14 Days Ago
<?php
declare(strict_types=1);
session_start();

if (empty($_SESSION['miter'])) {
	header('Location: ../../index.php');
	exit;
}

if (isset($_GET['d'])) {
	$raw_icon = $_GET['d'];
	
	$icon_name = preg_replace('/[^a-zA-Z0-9_\.-]/', '', basename($raw_icon));
	
	if ($icon_name !== '' && $icon_name !== '.' && $icon_name !== '..') {
		$img_file = "../../images/icons/{$icon_name}";
		
		if (file_exists($img_file) && is_file($img_file)) {
			unlink($img_file);
		}

		// log
		include 'otc.php';
		$log_data = "{$o_date} -- Deleted Icon: {$icon_name}\n";
		$log_file = 'log.txt';
		
		file_put_contents($log_file, $log_data, FILE_APPEND | LOCK_EX);
	}

	header('Location: ../../index.php?u=icons');
	exit;
}
Updates
Wedge - Android 126.026
Wedge - Linux 124.026
Shim - Android 117.026
Miter - 114.026
Kerf - Android 112.026
Dev
TVShow (227) 'CSA'
TVShow (228) 'APT'
TVProgram (83) 'BXT'
Miter Update(s)
Peen (Messaging)

Menu
Calendar
Project Tin (024/029)
Miter
RSS Feed