Skip to content

Commit

Permalink
Fixed anchors
Browse files Browse the repository at this point in the history
  • Loading branch information
gorriecoe committed Apr 27, 2016
1 parent 5a95202 commit 7cd9257
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion code/models/Section.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public static function Type($ClassName = NULL){
*/
public function Anchor(){
if ($this->MenuTitle && $this->ShowInMenus) {
return strtolower(str_replace(' ','',$this->MenuTitle));
return strtolower(trim(preg_replace('/[^a-zA-Z0-9]+/', '-',$this->MenuTitle), '-'));
}
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion code/models/SectionsListItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function getNiceStatus() {

public function Anchor(){
if ($this->Title) {
return strtolower(str_replace(' ','',$this->Title));
return strtolower(trim(preg_replace('/[^a-zA-Z0-9]+/', '-',$this->Title), '-'));
}
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion code/models/SectionsPerson.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public function canCreate($member = null)

public function Anchor(){
if ($this->Name) {
return strtolower(str_replace(' ','',$this->Name));
return strtolower(trim(preg_replace('/[^a-zA-Z0-9]+/', '-',$this->Name), '-'));
}
return false;
}
Expand Down

0 comments on commit 7cd9257

Please sign in to comment.