Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Global primitives to ESCape strings?
#1
Hi all,

Do you have global functions or templates tags
to clean values prior echoing ?

i'm used to the WP esc_html/esc_js and i'm looking for GS equivalents to:
PHP Code:
esc_html $string ); //  intended to be used in HTML alt="" or title=""
esc_js $string ); // for echos in JS alert()/confirm() 

Escapes single quotes, htmlspecialchar " < > &, and fix line endings. Escapes text strings for echoing in HTML alt="" or title="" or for echoing in JS, i.e. intended to be used for inline JS (in a tag attribute, for example onclick="…" or alert()/confirm()).


Thanks in advance for your help
Reply
#2
I think that GS has no function for that.
Maybe you can use
PHP Code:
htmlspecialchars($stringENT_QUOTES); 
Reply
#3
We have some old weird functions that i am still not entirely sure what they do. cl() for example.
Most of them seem they were written for outputting specific fields or xml fields. They are not documented well so youll have to go through the logic of them. But there are a few. These would be handy to have.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply




Users browsing this thread: 1 Guest(s)