Project

General

Profile

Feature #12023

MySQL Stored Precdure: QDECODESPECIALCHAR()

Added by Carsten Rose 8 months ago. Updated 8 months ago.

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

0%

Estimated time:
Discuss:

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
#1

Updated by Carsten Rose 8 months 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 ;
#2

Updated by Carsten Rose 8 months ago

Also available in: Atom PDF