938 Posts in 271 Topics by 291 members
Forum Module
SilverStripe Forums » Forum Module » Membernames with ampersand throw exeption
Discuss the Forum Module.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 850 Views |
-
Membernames with ampersand throw exeption

15 September 2009 at 9:11pm
Hi,
I have one member in my Forum that has an "&" in his membername (Riley & Tood). If I try to view his profile in the frontend I get an errormessage:
<a href="/foren/">Foren</a> » Riley & Tood's Benutzerprofil
-------------------------------------------^Is this a known bug?
-
Re: Membernames with ampersand throw exeption

15 September 2009 at 11:28pm
It's not a bug. It's just incorrectly escaped characters. In XML (and therefore also XHTML), & must be escaped to &
What you could try is to ouput $Fieldname.XML in your template (instead of just $Fieldname) -
Re: Membernames with ampersand throw exeption

16 September 2009 at 3:38am
Hello Banal,
thanks for your help. After adding nickname.XML I found out that the problem came from the breadcrumbs. The breadcrumbs show the username when you view the user´s profile. I added an htmlentities() to ForumMemberProfile.php:
public function Breadcrumbs() {
$nonPageParts = array();
$parts = array();$forumHolder = $this->ForumHolder();
$member = $this->Member();
$parts[] = "<a href=\"{$forumHolder->Link()}\">{$forumHolder->Title}</a>";
$nonPageParts[] = htmlentities($this->Title);
...I did some frontend testing and didn´t find any bug caused by that change.
| 850 Views | ||
|
Page:
1
|
Go to Top |


