From 47d7000cc8442644b1b55e90c65e13e245ba3533 Mon Sep 17 00:00:00 2001 From: Terranom674 Date: Wed, 19 Aug 2026 23:48:16 +0200 Subject: [PATCH] Restore stable watermark settings --- tools/watermark_settings.inc.php | 54 -------------------------------- 1 file changed, 54 deletions(-) diff --git a/tools/watermark_settings.inc.php b/tools/watermark_settings.inc.php index 4e29868..cfa2948 100644 --- a/tools/watermark_settings.inc.php +++ b/tools/watermark_settings.inc.php @@ -4,59 +4,6 @@ if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); } -function bratonien_tools_watermark_cache_dir() -{ - return PHPWG_ROOT_PATH.PWG_DERIVATIVE_DIR.'bratonien-watermark'; -} - -function bratonien_tools_remove_tree($path) -{ - $path = rtrim((string)$path, DIRECTORY_SEPARATOR); - if ($path === '' || !file_exists($path)) return; - - if (is_file($path) || is_link($path)) - { - @unlink($path); - return; - } - - foreach (scandir($path) ?: array() as $entry) - { - if ($entry === '.' || $entry === '..') continue; - bratonien_tools_remove_tree($path.DIRECTORY_SEPARATOR.$entry); - } - @rmdir($path); -} - -function bratonien_tools_clear_watermark_cache() -{ - $dir = bratonien_tools_watermark_cache_dir(); - $derivative_root = realpath(PHPWG_ROOT_PATH.PWG_DERIVATIVE_DIR); - $parent = realpath(dirname($dir)); - - if ($derivative_root === false || $parent === false || $parent !== $derivative_root) - { - throw new RuntimeException('Wasserzeichen-Cachepfad ist ungueltig.'); - } - - if (is_dir($dir)) - { - bratonien_tools_remove_tree($dir); - } -} - -function bratonien_tools_watermark_cache_upgrade() -{ - $version = '0.9.7.13'; - if ((string)conf_get_param('bratonien_watermark_cache_version', '') === $version) - { - return; - } - - bratonien_tools_clear_watermark_cache(); - conf_update_param('bratonien_watermark_cache_version', $version); -} - function bratonien_tools_get_watermark_defaults() { $defaults = conf_get_param('bratonien_watermark_defaults', null); @@ -93,7 +40,6 @@ function bratonien_tools_save_watermark_defaults() ); conf_update_param('bratonien_watermark_defaults', json_encode($config)); - bratonien_tools_clear_watermark_cache(); return array('message'=>'Globale Wasserzeichenregeln gespeichert.'); }