!is', $fudml)) {
$fudml = preg_replace('!\
\
(.*?)\\
!is', '[spoiler=\1]', $fudml);
$fudml = str_replace('
', '[/spoiler]', $fudml);
}
$fudml = str_replace('
.*?!is', $fudml, $m)) {
$fudml = preg_replace('!
(.*?)!is', '['.$v.'=\1]\2[/'.$v.']', $fudml);
}
}
while (preg_match('!
.*?!is', $fudml)) {
$fudml = preg_replace('!
(.*?)!is', '[acronym=\1]\2[/acronym]', $fudml);
}
while (preg_match('!<(o|u)l type=".+?">.*?\\1l>!is', $fudml)) {
$fudml = preg_replace('!<(o|u)l type="(.+?)">(.*?)\\1l>!is', '[list type=\2]\3[/list]', $fudml);
}
$fudml = str_replace(
array(
'
', '', '
', '', '
', '', '
', '', '
', '', '
', '', '
', '',
'
', '
', '
', '
', '
',
'
', '
', '', '
', '@', '://', '
', '', '
','
'
),
array(
'[b]', '[/b]', '[i]', '[/i]', '[u]', '[/u]', '[s]', '[/s]', '[sub]', '[/sub]', '[sup]', '[/sup]', '[del]', '[/del]',
'[code]', '[/code]', '[align=center]', '[align=left]', '[align=right]', '[/align]', '[list]', '[/list]',
'[notag]', '[/notag]', '[*]', '@', '://', '', '[pre]', '[/pre]','[hr]'
),
$fudml);
while (preg_match('!!is', $fudml)) {
$fudml = preg_replace('!!is', '[img]\1[/img]', $fudml);
}
while (preg_match('!!is', $fudml)) {
$fudml = preg_replace('!!is', '[img\1]\2[/img\1]', $fudml);
}
while (preg_match('!\\1!is', $fudml)) {
$fudml = preg_replace('!\\1!is', '[email]\1[/email]', $fudml);
}
while (preg_match('!\\1!is', $fudml)) {
$fudml = preg_replace('!\\1!is', '[url]\1[/url]', $fudml);
}
if (strpos($fudml, '!is', '[img=\1]\2[/img]', $fudml);
}
if (strpos($fudml, '!is', '[img\1=\2]\3[/img\1]', $fudml);
}
if (strpos($fudml, '(.+?)!is', '[email=\1]\2[/email]', $fudml);
}
if (strpos($fudml, '(.+?)!is', '[url=\1]\2[/url]', $fudml);
}
if (isset($php)) {
$fudml = str_replace(array_keys($php), array_values($php), $fudml);
}
/* unhtmlspecialchars */
return reverse_fmt($fudml);
}
function filter_ext($file_name)
{
include $GLOBALS['FORUM_SETTINGS_PATH'] . 'file_filter_regexp';
if (empty($GLOBALS['__FUD_EXT_FILER__'])) {
return;
}
if (($p = strrpos($file_name, '.')) === false) {
return 1;
}
return !in_array(strtolower(substr($file_name, ($p + 1))), $GLOBALS['__FUD_EXT_FILER__']);
}
function safe_tmp_copy($source, $del_source=0, $prefx='')
{
if (!$prefx) {
$prefx = getmypid();
}
$umask = umask(($GLOBALS['FUD_OPT_2'] & 8388608 ? 0177 : 0111));
if (!move_uploaded_file($source, ($name = tempnam($GLOBALS['TMP'], $prefx.'_')))) {
return;
}
umask($umask);
if ($del_source) {
@unlink($source);
}
umask($umask);
return basename($name);
}
function reverse_nl2br($data)
{
if (strpos($data, '
') !== false) {
return str_replace('
', '', $data);
}
return $data;
}
?>