aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Siegfried <david.siegfried@uni-vechta.de>2024-05-21 07:13:15 +0000
committerDavid Siegfried <david.siegfried@uni-vechta.de>2024-05-21 07:13:15 +0000
commitc89b17558da887a4e1c4164307b54b0576c23376 (patch)
tree6c31beb8c541891daff75c9c2772cfd58a53537d
parent2cc48e888d92517381e902c1b1a34a76d2293c34 (diff)
remove StudipTransformFormat, fixes #4188
Closes #4188 Merge request studip/studip!3024
-rw-r--r--RELEASE-NOTES.md1
-rw-r--r--lib/classes/StudipTransformFormat.php99
2 files changed, 1 insertions, 99 deletions
diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md
index 3253801..556cee6 100644
--- a/RELEASE-NOTES.md
+++ b/RELEASE-NOTES.md
@@ -56,6 +56,7 @@
- `getPresenceTypes()`
- Die Klasse `AuxLockRules` wurde ausgebaut. ([Issue #4187](https://gitlab.studip.de/studip/studip/-/issues/4187))
- Die Klasse `ProfileModel` wurde gelöscht. Die darin enthaltenen Methoden wurden in den `Profile_Controller` verschoben. ([Issue #4185]https://gitlab.studip.de/studip/studip/-/issues/4185))
+- Die Klasse `StudipTransformFormat` wurde ausgebaut ([Issue #4188](https://gitlab.studip.de/studip/studip/-/issues/4188))
## Security related issues
diff --git a/lib/classes/StudipTransformFormat.php b/lib/classes/StudipTransformFormat.php
deleted file mode 100644
index 04cf7a3..0000000
--- a/lib/classes/StudipTransformFormat.php
+++ /dev/null
@@ -1,99 +0,0 @@
-<?php
-/**
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * @author <mlunzena@uos.de
- * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2
- * @category Stud.IP
- */
-
-/**
- * Format class to transform text before it is saved into the database.
- * @deprecated since Stud.IP 5.3
- */
-class StudipTransformFormat extends TextFormat
-{
- /**
- * list of global Stud.IP transform markup rules
- */
- private static $studip_rules = [
- 'signature' => [
- 'start' => '(?<!~)~~~(?!~)',
- 'callback' => 'StudipTransformFormat::markupSignature'
- ]
- ,'nop' => [
- 'start' => '\[nop\](.*?)\[\/nop\]',
- 'callback' => 'StudipTransformFormat::markupNoFormat'
- ],
- ];
-
- /**
- * Returns the list of global Stud.IP markup rules as an array.
- * Each entry has the following attributes: 'start', 'end' and
- * 'callback'. The rule name is used as the entry's array key.
- *
- * @return array list of all markup rules
- */
- public static function getStudipMarkups()
- {
- return self::$studip_rules;
- }
-
- /**
- * Adds a new markup rule to the global Stud.IP markup set. This can
- * also be used to replace an existing markup rule. The end regular
- * expression is optional (i.e. may be NULL) to indicate that this
- * rule has an empty content model. The callback is called whenever
- * the rule matches and is passed the following arguments:
- *
- * - $markup the markup parser object
- * - $matches match results of preg_match for $start
- * - $contents (parsed) contents of this markup rule
- *
- * @param string $name name of this rule
- * @param string $start start regular expression
- * @param string $end end regular expression (optional)
- * @param callback $callback function generating output of this rule
- */
- public static function addStudipMarkup($name, $start, $end, $callback)
- {
- self::$studip_rules[$name] = compact('start', 'end', 'callback');
- }
-
- /**
- * Removes a markup rule from the global Stud.IP markup set.
- *
- * @param string $name name of the rule
- */
- public static function removeStudipMarkup($name)
- {
- unset(self::$studip_rules[$name]);
- }
-
- /**
- * Initializes a new StudipFormat instance.
- */
- public function __construct()
- {
- parent::__construct(self::getStudipMarkups());
- }
-
- /**
- * Stud.IP markup for signatures
- */
- protected static function markupSignature($markup, $matches)
- {
- return get_fullname();
- }
-
- /**
- * Stud.IP markup for unformatted text
- */
- protected static function markupNoFormat($markup, $matches)
- {
- return '[nop]' . $markup->quote($matches[1]) . '[/nop]';
- }
-}