[SOLVED] Send user data to third party site

9 years 6 months ago #249915 by bins
Replied by bins on topic Send user data to third party site
Doesn't seem to work!

Please Log in to join the conversation.

9 years 6 months ago #249922 by nant
Replied by nant on topic Send user data to third party site

bins wrote: Doesn't seem to work!


I tested this:

1. Created a delimiter field in the COntact info tab
2. Delimiter field has following in its description:
Helli [firstname]

If I view my profile in frontend I see Hello Nick.

How are you testing?

Please Log in to join the conversation.

9 years 6 months ago #249930 by bins
Replied by bins on topic Send user data to third party site
I am testing it in the url string, to pass data to the third party.

I have not put the field in a tab, as it is duplicate data and does not need to be repeated or seen - it is just for the link.

Can I PM the info over to you?

Please Log in to join the conversation.

9 years 6 months ago #251670 by nant
Replied by nant on topic Send user data to third party site

bins wrote: I am testing it in the url string, to pass data to the third party.

I have not put the field in a tab, as it is duplicate data and does not need to be repeated or seen - it is just for the link.

Can I PM the info over to you?



Here is my sample.

I created a CB 2.0 Custom HTML field (known as delimiter field in CB 191).


In this field's description I put the following html code (you need to set your editor in order to input html):
<p><a href="http://www.thridparty.com/script.php?username=[username]" target="_blank">URL Button</a></p>

This will show the linked text URL Button which would execute some script on a third-party site that can read the URL parameters.

Please Log in to join the conversation.

9 years 5 months ago - 9 years 5 months ago #252713 by nant
Replied by nant on topic Send user data to third party site
Ok - follow-up on this issue.

On all CB substitutions as a security measure all user inputed data gets sanitized.

This means that '<' -> &lt; '>' -> &gt; etc.

So if you have a CB Custom field (cb_custom) of the form:
<a href="#">[username]<a>

then the result will look like:
<a href="#">admin</a>

as only the CB field [username] is sanitized.

If however you then use the CB Content bot to add to a Joomla article something like:
{cb:[cb_custom]}

Then the code sanitizing will produce the following:
&lt;a href=&quot;#&quot;&gt;admin&lt;/a&gt;

Which will break you html rendering.

Instead you should directly use the following in your joomla article:
<a href="#">{cb:[username]}</a>

Also, please note that during the process I found a bug that is J3 related (no issue with J25) and will be fixed in next release of CB Content bot.

Please Log in to join the conversation.

9 years 5 months ago - 9 years 5 months ago #252716 by nant
Replied by nant on topic Send user data to third party site
Yet another follow-up based on off-forum discussion I had with Kyle:

Kyle (krileon): [FIELD_NAME] is raw value
Kyle (krileon): use [cb:userfield field="FIELD_NAME" /] and it'll work fine ONLY if the field actually allows HTML
Kyle (krileon): it's not a matter of escaping/safety.. that is already done by the field it self on output handling.. [FIELD_NAME] is always escaped

So, based on this, the following should work:

In your Joomla article instead of:
{cb:[cb_custom]}

use:
{cb:[cb:userfield field="cb_custom" /]}

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.231 seconds

Facebook Twitter LinkedIn