Code: Alles auswählen
[img]www.domain.de/signatur.php[/img]

Code: Alles auswählen
[img]www.domain.de/signatur.php[/img]
Code: Alles auswählen
// [img]image_url_here[/img] code..
$text = preg_replace("#\[img\]((ht|f)tp://)([^ \?&=\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text);
Code: Alles auswählen
// [img]image_url_here[/img] code..
$text = preg_replace("#\[img\]((ht|f)tp://)([^\r\n\t<\"]*?)\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text);
Code: Alles auswählen
function bbencode_first_pass($text, $uid,$allow_php_images)
{
.
.
.
// [img]image_url_here[/img] code..
if ($allow_php_images)
{
$text = preg_replace("#\[img\]((ht|f)tp://)([^\r\n\t<\"]*?)\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text);
} else
{
$text = preg_replace("#\[img\]((ht|f)tp://)([^ \?&=\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text);
}
Code: Alles auswählen
$php_img_user_list = explode(";",$board_config['user_allow_php_img']);
$user_allow_php_img = ( in_array($userdata['user_id'], $php_img_user_list)) ? true : false;
$message = bbencode_first_pass($message, $bbcode_uid, $user_allow_php_img);
Code: Alles auswählen
$text = preg_replace("#\[img\]((ht|f)tp://)([^ \?&=\"\n\r\t<]*?(\.(jpg|jpeg|gif|png|php)))\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text);
Weil ich keinen Plan von regulären Ausdrücken habDave hat geschrieben:Änderungen an der DB habe ich sowieso nicht vor sondern das wird im Code gemacht.
Danke für deinen Tipp... Aber wieso nimmst du die von 2.0.5 wenn du einfach ein php als endung bei der jetzigen hinzufügen kannst?Code: Alles auswählen
$text = preg_replace("#\[img\]((ht|f)tp://)([^ \?&="\n\r\t<]*?(\.(jpg|jpeg|gif|png|php)))\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text);
Ja jetzt match es auch auf php Dateien da aber nur authentifizierte User dies tun können sollte man noch das Userlevel etc. übergeben und abprüfen und dann ggf. das normale Pattern anwenden oder das für authentifizierte...........D@ve hat geschrieben:Weil ich keinen Plan von regulären Ausdrücken hab