anpera.net
https://anpera.homeip.net/phpbb3/

HTML in der Bio
https://anpera.homeip.net/phpbb3/viewtopic.php?f=25&t=4444
Seite 4 von 4

Autor:  Shaddar [ So 16 Dez, 2012 20:09 ]
Betreff des Beitrags:  Re: HTML in der Bio

Hm, ich finde den Thread irgendwie auch nicht wieder ^^

Aber ich meine das hier sollte es gewesen sein:

bio.php:

Einfügen:
$this->bbcode_second_pass_code('', '$allowedTags = '<h1><h2><h3><strong><b><u><em><i><center><span><font><p><ul><ol><li><hr><br><img><marquee><div><table><tr><td><sub><sup>';
$stripAttrib = 'javascript:|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup|onabort|onfocus|onload|onblur|onchange|onerror|onreset|onselect|obsubmit|onunload';

/**
* @return string
* @param string
* @desc Strip forbidden tags and delegate tag-source check to removeEvilAttributes()
*/
function removeEvilTags($source) {
global $allowedTags;
$source = strip_tags($source, $allowedTags);
return preg_replace('/<(.*?)>/ie', "'<'.removeEvilAttributes('\\1').'>'", $source); }

/**
* @return string
* @param string
* @desc Strip forbidden attributes from a tag
*/
function removeEvilAttributes($tagSource) {
global $stripAttrib;
return stripslashes(preg_replace("/$stripAttrib/i", 'forbidden', $tagSource)); }')

Suchen:
$this->bbcode_second_pass_code('', 'if ($row['bio']>"")
output("`n`^Bio: `@`n".soap($row['bio'])."`n");')

Ersetzen mit:
$this->bbcode_second_pass_code('', 'if ($row['bio']>""){
output("`n`^Bio: `@`n".CloseTags(removeEvilTags(soap($row['bio'])),"`c`b`i")."`n",true);
} ')

Die Variablen $allowedTags und $stripAttrib müsstest du dann nur noch an deine Bedürfnisse anpassen.

Seite 4 von 4 Alle Zeiten sind UTC + 1 Stunde
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/