Problems with Announcement Text

2 posts / 0 new
Last post
ejneuman
Problems with Announcement Text

After we upgraded to version 2.4, the href attribute is no longer working in the Announcements text.  I have succesfully used it within our About page and according to Administration Help these areas should accept similar HTML tags.  Perhaps I'm missing something very obvious. 

Any help would be appreciated!

 

 

chalpin
Re: Problems with Announcement Text

Hrm.  It appears that the help wasn't updated to reflect some changes that we made in other parts of CWIS.  In our default interface, we don't currently allow HTML tags in the announcements.  This was part of a CWIS-wide code audit where we limited use of HTML tags to prevent cross-site scripting attacks. But, we might want to allow some HTML tags in announcements, and there might want to be a configuration option to specify which ones.  I'll have to discuss with the other development staff.  At the very least, we'll need to make sure that the help is accurate.

You can work around this by creating a custom version of Home.html in a custom interface.  If you don't already have a custom interface, you can make one by creating a folder under local/interface/NameOfYourInterfaceHere.  Then copy Home.html into that folder from interface/default/Home.html.  On line 47 of your custom version, change nl2br(defaulthtmlentities($Text)) to nl2br($Text).  If you do this, you'll want to be sure that you only give the News Administrator privelege to trusted users because anyone who can edit news can insert arbitrary javascript into your site.  Lastly, set your new custom interface to the default in your system configuration.

Let me know if there are any problems.