Project

General

Profile

Actions

Feature #12023

open

MySQL Stored Precdure: QDECODESPECIALCHAR()

Added by Carsten Rose about 3 years ago. Updated about 3 years ago.

Status:
New
Priority:
Normal
Assignee:
Carsten Rose
Target version:
Start date:
16.02.2021
Due date:
% Done:

0%

Estimated time:
Discuss:
Prio Planung:
Vote:

Description

Mitunter waere es hilfreich wenn man Text aus der DB einfach htmlSpecialChar decode machen koennte.

Die Escape Class 'h' ist gut bei QFQ Variablen, hilft aber nicht wenn die Daten direkt aus der DB kommen und ausgegeben werden sollen


Related issues

Related to QFQ - Feature #12022: New escape class: htmlSpecialCharClosedCarsten Rose15.02.2021

Actions
Actions #1

Updated by Carsten Rose about 3 years ago

DELIMITER $$
CREATE DEFINER = `root`@`localhost` FUNCTION `QDECODESPECIALCHAR`(x longtext)
 RETURNS longtext
    NO SQL
    DETERMINISTIC
BEGIN
DECLARE TextString LONGTEXT;
SET TextString = x ;

SET TextString = REPLACE(TextString, '&','&') ;
SET TextString = REPLACE(TextString, '"','"') ;
SET TextString = REPLACE(TextString, ''',"'") ;
SET TextString = REPLACE(TextString, ''',"'") ;
SET TextString = REPLACE(TextString, '&lt;','<') ;
SET TextString = REPLACE(TextString, '&gt;','>') ;

RETURN TextString ;
END$$
DELIMITER ;
Actions #2

Updated by Carsten Rose about 3 years ago

Actions

Also available in: Atom PDF