Skip to Content Skip to Menu

[SOLVED] Send user data to third party site

  • bins
  • bins
  • OFFLINE
  • Posts: 465
  • Thanks: 40
  • Karma: 4
10 years 2 weeks ago #249915 by bins
Replied by bins on topic Send user data to third party site
Doesn't seem to work!

Please Log in or Create an account to join the conversation.

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
10 years 1 week 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 or Create an account to join the conversation.

  • bins
  • bins
  • OFFLINE
  • Posts: 465
  • Thanks: 40
  • Karma: 4
10 years 1 week 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 or Create an account to join the conversation.

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
9 years 11 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):
Code:
<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 or Create an account to join the conversation.

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
9 years 11 months ago - 9 years 11 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:
Code:
<a href="#">[username]<a>

then the result will look like:
Code:
<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:
Code:
{cb:[cb_custom]}

Then the code sanitizing will produce the following:
Code:
&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:
Code:
<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.
Last edit: 9 years 11 months ago by nant.

Please Log in or Create an account to join the conversation.

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
9 years 11 months ago - 9 years 11 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:
Code:
{cb:[cb_custom]}

use:
Code:
{cb:[cb:userfield field="cb_custom" /]}
Last edit: 9 years 11 months ago by nant.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum