Support

Home Forums Event Espresso Premium URLs containing ':' in Event meta break the Event update function

URLs containing ':' in Event meta break the Event update function

Posted: September 12, 2013 at 8:21 am


Scott Prath

September 12, 2013 at 8:21 am

This is a continuation of the following closed topic:
https://eventespresso.com/topic/cannot-save-promo-code-settings-on-events/

After further research, it appears that we are unable to save URLs in the Event Meta values due to the the colon character: ‘:’ (for example: http://www.link.com)

It looks like these values are passed in the following manner to the server during the Event update process:

emeta[]:registration_link
emetad[]:http://www.link.com

I’m guessing that the : in the URL is being escaped properly and interpreted as the end of the key. This results in an incomplete save/update and a 404 error.

However, if I escape the value as follows, the Event saves properly: http://www.link.com

Do you have any suggestions on how to programmatically address this?

Thank you.


Sidney Harrell

September 12, 2013 at 9:28 pm

I used the “live http headers” add on for firefox, and what the browser sends is

&emeta%5B%5D=url&emetad%5B%5D=http%3A%2F%2Flink.com

In the database I then see it as (serialized data):

s:3:"url";s:15:"http://link.com";

It is processed in includes/event-management/update_event.php on line 310:

foreach ($_REQUEST['emeta'] as $k => $v) {
                $event_meta[$v] = sanitize_text_field($_REQUEST['emetad'][$k]);
            }

You could experiment with it there, comment out those lines, etc, to narrow down the cause. I didn’t have any problems saving a url on my test setup, so it may be something different in your setup. You aren’t on a Windows server, are you?


Sidney Harrell

September 12, 2013 at 9:31 pm

The forum software didn’t display the serialized data correctly. Let me try plaintext instead:
Edit: no, it sticks on the nofollow tag. It is right in the DB, though.

The support post ‘URLs containing ':' in Event meta break the Event update function’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso