Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2023-03-29 11:11:19

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,529
Website GitHub Twitter

Com_connect with escape !

Hi

I thinked to use the escape attribute with com_connect_text to filter what users are typing.

I used the code like this :

<txp:com_connect_text class="form-control" name="description" label="description" placeholder="Décrivez votre activité" required="0" escape="tag, db"/>

and the result is this below:

<label for="\&quot;description\&quot;" class="\&quot;form-control\&quot;">description</label><br><input class="\&quot;form-control\&quot;" id="\&quot;description\&quot;" name="\&quot;description\&quot;" type="\&quot;text\&quot;" maxlength="\&quot;100\&quot;" form="\&quot;comf31f8fdb253f7a1ce8722449b6bb3d0c\&quot;" placeholder="\&quot;Décrivez" votre="" activité\"="">

It s quite funny no, i presume that the escape attribut cant be used in this case ?

Cheers.

Offline

#2 2023-03-29 11:22:40

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,269
Website GitHub

Re: Com_connect with escape !

Hmmm. Maybe the plugin is escaping its own info and not passing the attribute on to the global attribute handler. Oleg might be able to shed some light on this. Otherwise I’ll try and take a look later.

Edit: actually, escape isn’t usually used like this anyway. It doesn’t escape the content of what will be passed back from the form. It only escapes what is put on the page, so it’s doing what you asked. It’s just the output seems kinda of odd compared to what you might expect. Maybe there’s an opportunity to be more clever here, although (from memory) I think data is pretty well sanitized when it’s sent. Might be wrong.

Last edited by Bloke (2023-03-29 11:27:23)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#3 2023-03-29 11:37:37

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,078
Website

Re: Com_connect with escape !

That sounds a bit similar to an issue I had with escape (applied to <txp:meta_description escape="tags" /> in this thread.

In your case the esc works on txp:com_connect_text, not on what is in the value attribute – what the user actually fills in.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#4 2023-03-30 07:29:21

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,529
Website GitHub Twitter

Re: Com_connect with escape !

Thanks for explanation.

That confirm what i thinked.

Offline

Board footer

Powered by FluxBB