Changeset 1770
- Timestamp:
- 11/17/2008 11:20:56 PM (7 weeks ago)
- Files:
-
- 1 modified
-
trunk/scripts/bbcode.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/scripts/bbcode.php
r1688 r1770 3 3 require_once JLOG_BASEPATH.'/scripts/stringparser_bbcode.class.php'; 4 4 5 // Zeilenumbr ᅵche verschiedener Betriebsysteme vereinheitlichen5 // ZeilenumbrÃŒche verschiedener Betriebsysteme vereinheitlichen 6 6 function convertlinebreaks ($text) { 7 7 return preg_replace ("/\015\012|\015|\012/", "\n", $text); … … 66 66 else return true; 67 67 } 68 $title = empty($attributes["title"]) ? "" : " title='". $attributes["title"]."'";68 $title = empty($attributes["title"]) ? "" : " title='".htmlspecialchars($attributes["title"])."'"; 69 69 70 if (isset($attributes['class']) AND isset($attributes['caption'])) $class _caption= " class='img ".htmlspecialchars($attributes['class'])."'";70 if (isset($attributes['class']) AND isset($attributes['caption'])) $class = " class='img ".htmlspecialchars($attributes['class'])."'"; 71 71 elseif (isset($attributes['class'])) $class = " class='".htmlspecialchars($attributes['class'])."'"; 72 72 73 if (strpos($content, "http://") === 0) return "<img src='".htmlspecialchars($content)."'".$class." alt='". $attributes['alt']."'".$title." />";73 if (strpos($content, "http://") === 0) return "<img src='".htmlspecialchars($content)."'".$class." alt='".htmlspecialchars($attributes['alt'])."'".$title." />"; 74 74 else { 75 75 list($img_width, $img_height, $img_type, $img_attr) = @getimagesize(JLOG_BASEPATH.'/img'.DIRECTORY_SEPARATOR.htmlspecialchars($content)); 76 $img = "<img src='".JLOG_PATH."/img/".htmlspecialchars($content)."'".$class." alt='". $attributes['alt']."' style='width: ".$img_width."px;'".$title." />";76 $img = "<img src='".JLOG_PATH."/img/".htmlspecialchars($content)."'".$class." alt='".htmlspecialchars($attributes['alt'])."' style='width: ".$img_width."px;'".$title." />"; 77 77 } 78 78 79 79 if(isset($attributes['caption'])) { 80 return "\n<dl".$class _caption." style='width: ".$img_width."px;'>\n <dt>".$img."</dt>\n <dd>".$attributes['caption']."</dd>\n</dl>\n";80 return "\n<dl".$class." style='width: ".$img_width."px;'>\n <dt>".$img."</dt>\n <dd>".htmlspecialchars(attributes['caption'])."</dd>\n</dl>\n"; 81 81 } 82 82 else return $img;
