Skip Navigation

[Resuelto] Issues with URL encoding

This support ticket is created hace 4 años, 3 meses. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 3 respuestas, has 2 mensajes.

Last updated by Craig hace 4 años, 3 meses.

Assisted by: Nigel.

Autor
Mensajes
#1418109

Hi there,
I am trying to troubleshoot an issue I am having with a URL which is being passed to another page which contains a contact form. The Loop I am using is below:-

<wpv-loop>
<div class="col-sm-4 staff-member search-results">
<a href='../contact-form/?emailto=[wpv-post-title]'>[wpv-post-featured-image size="custom" attr="class=image-size" width="156" height="208"]<br />[wpv-post-title output='raw']</a><br />[types field="position" id=""][/types]
</div>
</wpv-loop>

The issue is when the Post Title (which is a persons name) contains an apostrophe, the URL returns a 403 Error.

I have tried adding output='sanitize' or output='raw' to the shortcode, but neither work. Is there a way to allow apostrophes to work in the URL?

The URL where the issue currently is – hidden link
The person in question is Yvonne O’Hara, all other links work OK.

Hope you can help.

Kind regards,
Craig

#1418179

Nigel
Supporter

Languages: Inglés (English ) Español (Español )

Timezone: Europe/London (GMT+00:00)

You need to URL encode the title (which isn't an output option of the Views shortcodes), so you would likely need to create a custom shortcode for this.

You could create a specific shortcode to output the URL encoded title, or you could register a generic shortcode to encode whatever was within it, something like:

add_shortcode('urlencode', function ($atts = [], $content = null) {

    return urlencode( wpv_do_shortcode( $content ) );
});

which you could then use like:

[urlencode][wpv-post-title][/urlencode]
#1418187

Hi Nigel,

That is fabulous. Thank you so much for that.

Have a Merry Christmas!

Best regards,
Craig

#1418189

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.