Welcome to Geeklog, Anonymous Thursday, November 28 2024 @ 11:00 pm EST
Geeklog Forums
HTML broken in event location and/or details - Bug or Feature
Status: offline
mst3kroqs
Forum User
Regular Poster
Registered: 10/18/05
Posts: 78
Location:Cary, NC USA
Hi -
OK, I searched everywhere, but cannot find reference to a report/fix on this issue.
Somewhere between 1.3sr-whatever and 1.4sr5, HTML in events details stopped working.
I can see the html tags being displayed in the event details, but obviously they are 'escaped' in some way so that the browser does not render them.
Further investigation of the events table indicates that events created with the newer code do not have a 'postmode' value associated with them.
In versions prior to 1.4, the default value for this field was 'PLAINTEXT' (even so, the HTML tags still worked)
The calendar event creation form also does not provide for a 'postmode' option (can't remember if the older code did this or not).
For grins, I manually edited the field for one of the events, and set it to 'HTML', just to see if it made a difference in the rendering process, but no joy. I also set it to PLAINTEXT to see if it would act like the older version - again, nothing doing.
It would appear that the event detail display code is somehow preventing the HTML tags from being supplied 'natively' to the client browser.
I searched 'calendar_event.php', and the only place I could see a reference to 'postmode' was in the following, line 670:
if ($A['postmode'] == 'plaintext') {
$A['description'] = nl2br ($A['description']);
}
But it didn't look like this would be the culprit (and commenting it out did not help).
As you can see, I know just about enough to be dangerous - can anyone else offer confirmation of this as a bug, feature, or perhaps even suggest a fix or hack?
Would greatly appreciate a response - this is a badly-needed functionality on our site.
Thanks, and best regards.
OK, I searched everywhere, but cannot find reference to a report/fix on this issue.
Somewhere between 1.3sr-whatever and 1.4sr5, HTML in events details stopped working.
I can see the html tags being displayed in the event details, but obviously they are 'escaped' in some way so that the browser does not render them.
Further investigation of the events table indicates that events created with the newer code do not have a 'postmode' value associated with them.
In versions prior to 1.4, the default value for this field was 'PLAINTEXT' (even so, the HTML tags still worked)
The calendar event creation form also does not provide for a 'postmode' option (can't remember if the older code did this or not).
For grins, I manually edited the field for one of the events, and set it to 'HTML', just to see if it made a difference in the rendering process, but no joy. I also set it to PLAINTEXT to see if it would act like the older version - again, nothing doing.
It would appear that the event detail display code is somehow preventing the HTML tags from being supplied 'natively' to the client browser.
I searched 'calendar_event.php', and the only place I could see a reference to 'postmode' was in the following, line 670:
if ($A['postmode'] == 'plaintext') {
$A['description'] = nl2br ($A['description']);
}
But it didn't look like this would be the culprit (and commenting it out did not help).
As you can see, I know just about enough to be dangerous - can anyone else offer confirmation of this as a bug, feature, or perhaps even suggest a fix or hack?
Would greatly appreciate a response - this is a badly-needed functionality on our site.
Thanks, and best regards.
4
8
Quote
Status: offline
mst3kroqs
Forum User
Regular Poster
Registered: 10/18/05
Posts: 78
Location:Cary, NC USA
(this doesn't count as talking to myself, does it?)
Narrowed the problem down to the event entry code. Looking at events table entries with phpMyAdmin that were entered with the previous version of the code, you can see HTML undisturbed.
Events created with new version, or old events edited by new version have 'special' characters 'escaped', eg the url:
<a href="http://www.cshl.us">Our Website</a>
Is stored in table thusly (replace *'s with ampersands, can't display it literally here):
*lt;a href=*quot;http://www.cshl.us*quot;*gt;Our Website*lt;/a*gt;
Fun, huh?
Now I'm off to track down the nasty bit of code that is doing this. Anyone have a function name I can look for?
Thanks.
Narrowed the problem down to the event entry code. Looking at events table entries with phpMyAdmin that were entered with the previous version of the code, you can see HTML undisturbed.
Events created with new version, or old events edited by new version have 'special' characters 'escaped', eg the url:
Text Formatted Code
<a href="http://www.cshl.us">Our Website</a>
Is stored in table thusly (replace *'s with ampersands, can't display it literally here):
Text Formatted Code
*lt;a href=*quot;http://www.cshl.us*quot;*gt;Our Website*lt;/a*gt;
Fun, huh?
Now I'm off to track down the nasty bit of code that is doing this. Anyone have a function name I can look for?
Thanks.
10
6
Quote
Status: offline
mst3kroqs
Forum User
Regular Poster
Registered: 10/18/05
Posts: 78
Location:Cary, NC USA
Problem is in admin/event.php. For some reason, when we arrive at around line 460, $postmode is not set properly. I suspect this is derivative of the fact that there is no 'Post Mode' dropdown/option in the event editor template, and therefore this variable is not being set.
The hack/fix was to insert the line: $postmode = 'html'; prior to line 460 to ensure that the variable was defined. (The variable is undefined or null, and the following if statement treats anything other than 'html' as needing handling by 'htmlspecialchars' function, which was the function that was escaping all the special characters). Obviously, this means that all events will be submitted as html, but nobody said it was elegant.
If I get real brave, I'll try to understand the difference between the story editor and event editor templates in the 'professional' theme, and see if I can insert the postmode dropdown.
The hack/fix was to insert the line: $postmode = 'html'; prior to line 460 to ensure that the variable was defined. (The variable is undefined or null, and the following if statement treats anything other than 'html' as needing handling by 'htmlspecialchars' function, which was the function that was escaping all the special characters). Obviously, this means that all events will be submitted as html, but nobody said it was elegant.
If I get real brave, I'll try to understand the difference between the story editor and event editor templates in the 'professional' theme, and see if I can insert the postmode dropdown.
6
6
Quote
Status: offline
mst3kroqs
Forum User
Regular Poster
Registered: 10/18/05
Posts: 78
Location:Cary, NC USA
This was a theme problem.
(sigh)
The Professional theme included the necessary control, however I was using the SmoothBlue 1.41. theme which had purportedly been updated for 1.40.
Apparently, this theme hasn't been completely updated for this version of the code, I will work on continuing to fix the theme and will contact julianna to let her know what I can find.
(sigh)
The Professional theme included the necessary control, however I was using the SmoothBlue 1.41. theme which had purportedly been updated for 1.40.
Apparently, this theme hasn't been completely updated for this version of the code, I will work on continuing to fix the theme and will contact julianna to let her know what I can find.
5
4
Quote
All times are EST. The time is now 11:00 pm.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content