Changeset 1671
- Timestamp:
- 09/04/2007 06:36:09 PM (16 months ago)
- Location:
- trunk/scripts
- Files:
-
- 2 modified
-
bbcode.php (modified) (3 diffs)
-
general.func.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/scripts/bbcode.php
r1669 r1671 18 18 19 19 function do_bbcode_url ($action, $attributes, $content, $params, $node_object) { 20 20 21 // URL auslesen 21 22 $url = isset($attributes['default']) ? $attributes['default'] : $content; 22 23 23 // URL validieren (Fix #137)24 // URL validieren 24 25 if($action == 'validate') { 25 if('javascript:' == substr($url, 0, 11)) return false; 26 return true;26 if (isset($params["no_js"]) AND (stripos(trim($url), "javascript:")) === 0) return false; 27 return true; 27 28 } 28 29 29 // Optik bei relativen URLs verbessern30 // relative in absolute URLs umwandeln 30 31 if(!isset($attributes['default']) AND strpos($url, "/") === 0) { 31 32 $content = (isset($_SERVER['HTTPS']) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $url; 32 33 } 33 return '<a href="' . htmlspecialchars($url) . '">' . htmlspecialchars($content). '</a>';34 return '<a href="' . htmlspecialchars($url) . '">' . $content . '</a>'; 34 35 } 35 36 … … 120 121 $bbcode->setCodeFlag ('headline', 'opentag.before.newline', BBCODE_NEWLINE_DROP); 121 122 $bbcode->setCodeFlag ('headline', 'closetag.after.newline', BBCODE_NEWLINE_DROP); 122 # $bbcode->setCodeFlag ('html', 'paragraph_type', BBCODE_PARAGRAPH_BLOCK_ELEMENT);123 123 $bbcode->setCodeFlag ('html', 'opentag.before.newline', BBCODE_NEWLINE_DROP); 124 124 $bbcode->setCodeFlag ('html', 'closetag.after.newline', BBCODE_NEWLINE_DROP); … … 141 141 $bbcomments->addCode ('i', 'simple_replace', null, array ('start_tag' => '<em>', 'end_tag' => '</em>'), 142 142 'inline', array ('block', 'inline', 'link'), array ()); 143 $bbcomments->addCode ('url', 'usecontent?', 'do_bbcode_url', array ('usecontent_param' => 'default' ),143 $bbcomments->addCode ('url', 'usecontent?', 'do_bbcode_url', array ('usecontent_param' => 'default', 'no_js' => true), 144 144 'link', array ('block', 'inline'), array ('link')); 145 145 $bbcomments->addCode ('quote', 'simple_replace', null, array('start_tag' => '<blockquote>', 'end_tag' => '</blockquote>'), -
trunk/scripts/general.func.php
r1626 r1671 230 230 } 231 231 232 if (!function_exists("stripos")) { 233 function stripos($str,$needle,$offset=0) { 234 return strpos( strtolower($str), strtolower($needle), $offset ); 235 } 236 } 237 238 if(!function_exists('str_ireplace')){ 239 function str_ireplace($search, $replace, $subject){ 240 if(is_array($search)){ 241 array_walk($search, create_function('&$pat, $key', '"/".preg_quote($pat, "/")."/i"')); 242 } 243 else{ 244 $search = '/'.preg_quote($search, '/').'/i'; 245 } 246 return preg_replace($search, $replace, $subject); 247 } 248 } 249 232 250 // output the administration menu 233 251 function output_admin_menu() {
