diff options
author | Andreas Gohr <andi@splitbrain.org> | 2005-11-11 21:39:02 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2005-11-11 21:39:02 +0100 |
commit | 9d2ddea4dd0070b4ea2963387d5cd361de0afc97 (patch) | |
tree | 0d301f95d892ae0e8697a525f23400d190a65cf3 /inc/parser/xhtml.php | |
parent | c971ac6dd19bf45d86e2ce199d061393e628c1d8 (diff) | |
download | rpg-9d2ddea4dd0070b4ea2963387d5cd361de0afc97.tar.gz rpg-9d2ddea4dd0070b4ea2963387d5cd361de0afc97.tar.bz2 |
fix for bad characters in interwiki classes
darcs-hash:20051111203902-7ad00-d3cd09528f6732723652e1bb01ba6e8fb9b6205f.gz
Diffstat (limited to 'inc/parser/xhtml.php')
-rw-r--r-- | inc/parser/xhtml.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php index b3d97718c..f6dcbc038 100644 --- a/inc/parser/xhtml.php +++ b/inc/parser/xhtml.php @@ -578,7 +578,8 @@ class Doku_Renderer_xhtml extends Doku_Renderer { } if ( !$isImage ) { - $link['class'] = "interwiki iw_$wikiName"; + $class = preg_replace('/[^_\-a-z0-9]+/i','_',$wikiName); + $link['class'] = "interwiki iw_$class"; } else { $link['class'] = 'media'; } @@ -709,7 +710,8 @@ class Doku_Renderer_xhtml extends Doku_Renderer { $noLink = TRUE; }else{ // add file icons - $link['class'] .= ' mediafile mf_'.$ext; + $class = preg_replace('/[^_\-a-z0-9]+/i','_',$ext); + $link['class'] .= ' mediafile mf_'.$class; $link['url'] = ml($src,array('id'=>$ID,'cache'=>$cache),true); } $link['name'] = $this->_media ($src, $title, $align, $width, $height, $cache); |