Vergleich inc/functions_post.php - 1.00 - 1.14

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://www.mybboard.com
* License: http://www.mybboard.com/eula.html
*

 * Website: http://www.mybboard.com
* License: http://www.mybboard.com/eula.html
*

 * $Id$

 * $Id: functions_post.php 934 2005-12-08 13:48:07Z chris $

 */

function postify($message, $allowhtml="no", $allowmycode="yes", $allowsmilies="yes", $allowimgcode="yes", $archive=0)

 */

function postify($message, $allowhtml="no", $allowmycode="yes", $allowsmilies="yes", $allowimgcode="yes", $archive=0)

Zeile 97Zeile 97
		$message = preg_replace("#\[list=(a|A|i|I|1)\](.*?)\[/list\]#esi", "dolist('$2', '$1')", $message);
}


		$message = preg_replace("#\[list=(a|A|i|I|1)\](.*?)\[/list\]#esi", "dolist('$2', '$1')", $message);
}


	if($allowimgcode)

	if($allowimgcode != "no")

	{

	{

		$message = preg_replace("#\[img\]([a-z]+?://){1}(.+?)\[/img\]#i", "<img src=\"$1$2\" border=\"0\" alt=\"\" />", $message);
$message = preg_replace("#\[img=([0-9]{1,3})x([0-9]{1,3})\]([a-z]+?://){1}(.+?)\[/img\]#i", "<img src=\"$3$4\" style=\"border: 0; width: $1; height: $2;\" alt=\"\" />", $message);

		$message = preg_replace("#\[img\](https?://([^<>\"']+?))\[/img\]#i", "<img src=\"$1\" border=\"0\" alt=\"\" />", $message);
$message = preg_replace("#\[img=([0-9]{1,3})x([0-9]{1,3})\](https?://([^<>\"']+?))\[/img\]#i", "<img src=\"$3\" style=\"border: 0; width: $1px; height: $2px;\" alt=\"\" />", $message);

	}
$message = doautourl($message);
/* Used to be <hr size="1"> but users should get the chance to set the size in their CSS */

	}
$message = doautourl($message);
/* Used to be <hr size="1"> but users should get the chance to set the size in their CSS */

Zeile 130Zeile 130
{
global $lang;
$message = preg_replace('#^/me (.*)$#im', "<span style=\"color: red;\">* $username \\1</span>", $message);

{
global $lang;
$message = preg_replace('#^/me (.*)$#im', "<span style=\"color: red;\">* $username \\1</span>", $message);

 
	$username = str_replace("'", "\\'", $username);

	$message = preg_replace('#^/slap (.*)#iem', "'<span style=\"color: red;\">* $username $lang->slaps '.str_replace('<br />', '', '\\1').' $lang->with_trout</span><br />'", $message);
return $message;
}

	$message = preg_replace('#^/slap (.*)#iem', "'<span style=\"color: red;\">* $username $lang->slaps '.str_replace('<br />', '', '\\1').' $lang->with_trout</span><br />'", $message);
return $message;
}

Zeile 137Zeile 138
function fixjavascript($message)
{
$message = preg_replace("#javascript:#i", "java script:", $message);

function fixjavascript($message)
{
$message = preg_replace("#javascript:#i", "java script:", $message);

	/* This patch provided by Ryan (try to remove XSS Cross-site scripting issues). */

	// this patch provided by Ryan (try to remove XSS Cross-site scripting issues).

	$message = preg_replace("#(a)(lert)#ie", "'&#'.ord($1).';$2'", $message);
$message = preg_replace("#onmouseover#i", "&#111;nmouseover", $message);
$message = preg_replace("#onmouseout#i", "&#111;nmouseout", $message);

	$message = preg_replace("#(a)(lert)#ie", "'&#'.ord($1).';$2'", $message);
$message = preg_replace("#onmouseover#i", "&#111;nmouseover", $message);
$message = preg_replace("#onmouseout#i", "&#111;nmouseout", $message);

Zeile 160Zeile 161
		reset($badwordcache);
foreach($badwordcache as $bid => $badword)
{

		reset($badwordcache);
foreach($badwordcache as $bid => $badword)
{

			if(!$badword['replacement'])
{
$badword['replacement'] = "*****";
}

			if(!$badword['replacement']) $badword['replacement'] = "*****";




			$badword['badword'] = str_replace("\\", "\\\\", $badword['badword']);
$message = preg_replace("#".$badword['badword']."#i", $badword['replacement'], $message);
}

			$badword['badword'] = str_replace("\\", "\\\\", $badword['badword']);
$message = preg_replace("#".$badword['badword']."#i", $badword['replacement'], $message);
}

Zeile 189Zeile 187
		reset($smiliecache);
foreach($smiliecache as $sid => $smilie)
{

		reset($smiliecache);
foreach($smiliecache as $sid => $smilie)
{

			$message = str_replace($smilie['find'], "<img src=\"".$url.$smilie['image']."\" align=\"middle\" border=\"0\" alt=\"".$smilie['name']."\" />", $message);

			$message = str_replace($smilie['find'], "<img src=\"".$url.$smilie['image']."\" style=\"vertical-align: middle;\" border=\"0\" alt=\"".$smilie['name']."\" />", $message);

		}
}
return $message;

		}
}
return $message;

Zeile 243Zeile 241
	{
$name = $email;
}

	{
$name = $email;
}

	if(preg_match("/^(.+)@[a-zA-Z0-9-]+\.[a-zA-Z0-9.-]+$/si", $email))

	if(preg_match("/^([a-zA-Z0-9-_\+\.]+?)@[a-zA-Z0-9-]+\.[a-zA-Z0-9\.-]+$/si", $email))

	{
return "<a href=\"mailto:$email\">".$name."</a>";

	{
return "<a href=\"mailto:$email\">".$name."</a>";

 
	}
else
{
return $name;

	}
}


	}
}


Zeile 267Zeile 269
	}
$message = str_replace("<div class=\"quote_body\"><br />", "<div class=\"quote_body\">", $message);
$message = str_replace("<br /></div>", "</div>", $message);

	}
$message = str_replace("<div class=\"quote_body\"><br />", "<div class=\"quote_body\">", $message);
$message = str_replace("<br /></div>", "</div>", $message);

 
	// Remove [attachment=x] from quoted posts.
//$message = preg_replace("#\[attachment=([0-9]+?)\]#i", "", $message);

	return $message;
}

function docode($message)

	return $message;
}

function docode($message)

{

{

	global $lang;

// user sanity check

	global $lang;

// user sanity check

Zeile 283Zeile 287
	if($opencount > $closedcount)
{
$limit = $closedcount;

	if($opencount > $closedcount)
{
$limit = $closedcount;

	}

	}

	elseif($closedcount > $opencount)
{
$limit = $opencount;

	elseif($closedcount > $opencount)
{
$limit = $opencount;

Zeile 342Zeile 346
	}

if(preg_match("/\A[\s]*\<\?/", $original) === 0)

	}

if(preg_match("/\A[\s]*\<\?/", $original) === 0)

	{
$code = substr_replace($code, "", strpos($code, "&lt;?php"), strlen("&lt;?php"));
$code = strrev(substr_replace(strrev($code), "", strpos(strrev($code), strrev("?&gt;")), strlen("?&gt;")));
$code = str_replace('<br />', '', $code);
}





    {
$code = substr_replace($code, "", strpos($code, "&lt;?php"), strlen("&lt;?php"));
$code = str_replace('<br />', '', $code);
}

if(preg_match("/\A[\s]*\>\?/", strrev($original)) === 0)
{
$code = strrev(substr_replace(strrev($code), "", strpos(strrev($code), strrev("?&gt;")), strlen("?&gt;")));
}

	
// Get rid of other useless code and linebreaks
$code = str_replace("<code><font color=\"#000000\">\n", '', $code);

	
// Get rid of other useless code and linebreaks
$code = str_replace("<code><font color=\"#000000\">\n", '', $code);

Zeile 354Zeile 362
	$code = str_replace("</font>\n</code>", '', $code);

// Send back the code all nice and pretty

	$code = str_replace("</font>\n</code>", '', $code);

// Send back the code all nice and pretty

	return "</p><div class=\"code_header\">$lang->php_code</div><div class=\"code_body\">".$code."</div><p>";

	return "<p><div class=\"code_header\">$lang->php_code</div><div class=\"code_body\">".$code."</div></p>";

}

function makepostbit($post, $pmprevann=0)

}

function makepostbit($post, $pmprevann=0)