Project

General

Profile

Actions

Feature #12023

open

MySQL Stored Precdure: QDECODESPECIALCHAR()

Added by Carsten Rose over 1 year ago. Updated over 1 year ago.

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

0%

Estimated time:
Discuss:
Prio Planung:

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 over 1 year 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 over 1 year ago

Actions

Also available in: Atom PDF