[EventCalendar] RESOLVED at last!! ec3_get_calendar() not translating ampersands into character entities

ejm cq547 at torfree.net
Fri Oct 12 19:43:48 UTC 2007


Whoohoo!!! 

I can't thank you enough, Alex! And of course, now that I see what I
did to day.php, it makes sense that the semicolons were getting
stripped completely. I only hope that I have learned my lesson on this
and won't repeat it.... 

And this is not the only good news! Not only is the page validating
(for the most part - there are still some strangenesses that have
nothing to do with ec3 and everything to do with how the regular
authors of my wordpresses enter information for posts) , but the
problem with the calendar not displaying some of the months correctly
has been resolved as well. Hurrah!!

Once again, thanks go to all who have worked on this - you know who
you are! - But especially to you Alex, for creating and maintaining
this wonderful and useful plugin.

-Elizabeth

P.S.  I have also made the necessary changes to Dr. Peter Troxler's
ec3_past_events.php

//ejm ensure that ampersands etc. are translated into character
entities
//      $data['TITLE'] =$entry->post_title;
//      $data['LINK']  =get_permalink($entry->id);
//      $data['AUTHOR']=$entry->author;

$data['TITLE'] = wp_specialchars($entry->post_title);
$data['LINK']  = get_permalink($entry->id);
$data['AUTHOR']= wp_specialchars($entry->author);

On Fri, 12 Oct 2007 11:41:53 +0100, Alex Tingle <alex at firetree.net>
wrote:

>ejm wrote:
>> I am enclosing a zip file with eventcalendar3/day.php and
>> template-functions.php  for the two wordpresses I run:
>
>Ah ha! I've found your problem. The day.php file you sent me has this 
>comment:
>
>   // ejm change array(',','@'),
>   ...
>   // ejm change $safe_title.=' @'.$time;
>
>That's very well disciplined of you to note where you've made changes. 
>Unfortunately, that change has caused your troubles...
>
>Your version looks like this...
>
>// ejm change array(',','@'),
>     $safe_title=strip_tags($title);
>     $safe_title=
>       str_replace(
>         array(',',';'), <<===================== PROBLEM
>         ' ',
>         htmlspecialchars(
>           stripslashes($safe_title),
>           ENT_QUOTES,
>           get_settings('blog_charset')
>         )
>       );
>// ejm change $safe_title.=' @'.$time;
>     if($is_event)
>     {
>       $safe_title.='. '.$time;
>       $this->is_event=True;
>     }
>
>That replaces every ';' with ' ' - which is exactly what you are seeing.
>
>Obviously, you don't want the '@' symbol before the times. So, try this...
>
>     $safe_title=strip_tags($title);
>     $safe_title=
>       str_replace(
>         ',', // AT changed from: array(',','@'),
>         ' ',
>         htmlspecialchars(
>           stripslashes($safe_title),
>           ENT_QUOTES,
>           get_option('blog_charset')
>         )
>       );
>     if($is_event)
>     {
>       $safe_title.=' '.$time; // AT changed from: ' @'
>       $this->is_event=True;
>     }
>
>
> > Thank you very much for all your attention to this. It really is very
> > kind of you.
>
>Thank you for persisting with it. Obviously this is simply a problem 
>that you've introduced yourself, but the one you started with was a 
>genuine bug. That's fixed now, thanks to you.
>
>-Alex




More information about the EventCalendar mailing list