Version 2.2.2

This commit is contained in:
Neo committed 2025-12-19 00:24:35 -08:00
1 parent 22f1b963ee
commit a3bb603c96
858 files changed
+479463 -188140

No files matched your search

File diff suppressed because it is too large. Load diff
@@ -2,18 +2,28 @@
/*
+--------------------------------------------------------------------------
| Invision Power Board
| Invision Power Board 2.2.2
| =============================================
| by Matthew Mecham
| (c) 2001 - 2006 Invision Power Services, Inc.
| http://www.invisionpower.com
| =============================================
| Web: http://www.invisionboard.com
| http://www.ibresource.ru/products/invisionpowerboard/
| Time: Monday 05th of March 2007 10:10:54 PM
| Release: e3790216629e5a2aaf37070b32237f06
| Licence Info: http://www.invisionboard.com/?license
| http://www.ibresource.ru/license
+---------------------------------------------------------------------------
| > $Date: 2006-10-18 13:39:55 +0100 (Wed, 18 Oct 2006) $
| > $Revision: 653 $
| > $Author: matt $
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
+---------------------------------------------------------------------------
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $Date: 2006-11-29 16:22:46 -0600 (Wed, 29 Nov 2006) $
| > $Revision: 745 $
| > $Author: bfarber $
+---------------------------------------------------------------------------
|
| > BB Code Core Module
@@ -87,8 +97,8 @@
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
exit();
}
class class_bbcode_core
@@ -204,12 +214,13 @@ class class_bbcode_core
//-----------------------------------------
$_beginning_of_code = 0;
$_l_text = strtolower( $_text );
//----------------------------------------
// Look for opening [TAG].
//----------------------------------------
$found_tag_open = strpos( $_text, $tag_open, $found_tag_close );
$found_tag_open = strpos( $_l_text, $tag_open, $found_tag_close );
//----------------------------------------
// No logic found?
@@ -224,7 +235,7 @@ class class_bbcode_core
// End [/TAG] statement?
//----------------------------------------
$found_tag_close = strpos($_text, $tag_close, $found_tag_close );
$found_tag_close = strpos( $_l_text, $tag_close, $found_tag_open );
//----------------------------------------
// No end statement found
@@ -249,7 +260,7 @@ class class_bbcode_core
// Got an IF?
//----------------------------------------
$tag_found_recurse = strpos( $_text, $tag_open, $tag_found_recurse );
$tag_found_recurse = strpos( $_l_text, $tag_open, $tag_found_recurse );
//----------------------------------------
// None found...
@@ -262,11 +273,8 @@ class class_bbcode_core
$tag_end_recurse = $found_tag_close + strlen( $tag_close );
#print "[".$found_tag_close."]";
$found_tag_close = strpos( $_text, $tag_close, $tag_end_recurse );
#print "[-".$found_tag_close."-]"; print htmlspecialchars( $_text ); print "<hr>";
# Start at tag_found_recurse...
$found_tag_close = strpos( $_l_text, $tag_close, $tag_found_recurse );
//----------------------------------------
// None found...
@@ -290,7 +298,7 @@ class class_bbcode_core
// Recurse
//----------------------------------------
if ( strpos( $_code, $tag_open ) !== FALSE )
if ( strpos( strtolower( $_code ), $tag_open ) !== FALSE )
{
$_code = $this->parse_simple_tag_recursively( $tag_name, $convert_name, $bbcode, $_code );
}
@@ -418,19 +426,19 @@ class class_bbcode_core
// New quote
//-----------------------------------------
$t = preg_replace_callback( "#<!--quoteo([^>]+?)?-->(.+?)<!--quotec-->#si", array( $this, '_parse_new_quote'), $t );
$t = preg_replace_callback( "#<!--quoteo([^>]+?)?-->(.+?)<!--quotec-->#si", array( &$this, '_parse_new_quote'), $t );
//-----------------------------------------
// SQL
//-----------------------------------------
$t = preg_replace_callback( "#<!--sql-->(.+?)<!--sql1-->(.+?)<!--sql2-->(.+?)<!--sql3-->#is", array( $this, 'unconvert_sql'), $t );
$t = preg_replace_callback( "#<!--sql-->(.+?)<!--sql1-->(.+?)<!--sql2-->(.+?)<!--sql3-->#is", array( &$this, 'unconvert_sql'), $t );
//-----------------------------------------
// HTML
//-----------------------------------------
$t = preg_replace_callback( "#<!--html-->(.+?)<!--html1-->(.+?)<!--html2-->(.+?)<!--html3-->#is", array( $this, 'unconvert_htm'), $t );
$t = preg_replace_callback( "#<!--html-->(.+?)<!--html1-->(.+?)<!--html2-->(.+?)<!--html3-->#is", array( &$this, 'unconvert_htm'), $t );
//-----------------------------------------
// CODE
@@ -471,9 +479,47 @@ class class_bbcode_core
$t = preg_replace( "#<\{.+?\}>#", "", $t );
//-----------------------------------------
// Clean up code tags
//-----------------------------------------
//$t = preg_replace_callback( "#\[code\](.+?)\[/code\]#is" , array( $this, 'clean_ipb_html_code_tag' ), $t );
return $t;
}
/*-------------------------------------------------------------------------*/
// Clean up code tags for RTE body
/*-------------------------------------------------------------------------*/
/**
* Remove quote tags
*
* @param array Array of matches
* @return string Converted text
*/
function clean_ipb_html_code_tag( $matches )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$txt = $matches[1];
//-----------------------------------------
// Fix...
//-----------------------------------------
$txt = str_replace( "<" , "&lt;" , $txt );
$txt = str_replace( ">" , "&gt;" , $txt );
$txt = str_replace( "&#60;" , "&lt;" , $txt );
$txt = str_replace( "&#62;" , "&gt;" , $txt );
$txt = str_replace( "&lt;br&gt;" , "<br>" , $txt );
$txt = str_replace( "&lt;br /&gt;" , "<br>" , $txt );
return '[code]'.$txt.'[/code]';
}
/*-------------------------------------------------------------------------*/
// Strip quote tags
/*-------------------------------------------------------------------------*/
@@ -679,8 +725,8 @@ class class_bbcode_core
if ( $row['bbcode_useoption'] )
{
preg_match_all( "#(\[".$preg_tag."=(?:&quot;|&\#39;|\")?(.+?)(?:&quot;|&\#39;|\")?\])(.+?)(\[/".$preg_tag."\])#si", $t, $match );
while (preg_match_all( "#(\[".$preg_tag."=(?:&quot;|&\#39;|\")?(.+?)(?:&quot;|&\#39;|\")?\])((?R)|.*?)(\[/".$preg_tag."\])#si", $t, $match ))
{
for ( $i = 0; $i < count($match[0]); $i++)
{
//-----------------------------------------
@@ -690,10 +736,7 @@ class class_bbcode_core
$_option = 2;
$_content = 3;
$_o = strpos( $row['bbcode_replace'], '{option}' );
$_c = strpos( $row['bbcode_replace'], '{content}' );
if ( $_c < $_o )
if ( $row['bbcode_switch_option'] )
{
$_option = 3;
$_content = 2;
@@ -717,11 +760,13 @@ class class_bbcode_core
$t = str_replace( $match[0][$i], $tmp, $t );
}
}
}
else
{
# Tricky.. match anything that's not a closing tag, or nothing
preg_match_all( "#(\[$preg_tag\])(.+?)?(\[/$preg_tag\])#si", $t, $match );
while (preg_match_all( "#(\[$preg_tag\])((?R)|.*?)(\[/$preg_tag\])#si", $t, $match ))
{
for ( $i = 0; $i < count($match[0]); $i++)
{
# Recurse?
@@ -743,6 +788,7 @@ class class_bbcode_core
}
}
}
}
//-----------------------------------------
// Snapback used?
@@ -750,7 +796,7 @@ class class_bbcode_core
if ( ! $snapback )
{
$t = preg_replace( "#\[snapback\]([0-9]+?)\[/snapback\]is#", "<a href='index.php?act=findpost&amp;pid=\\1'><{POST_SNAPBACK}></a>", $t );
$t = preg_replace( "#\[snapback\]([0-9]+?)\[/snapback\]#is", "<a href='index.php?act=findpost&amp;pid=\\1'><{POST_SNAPBACK}></a>", $t );
}
return $t;
@@ -1017,10 +1063,11 @@ class class_bbcode_core
$html = preg_replace( "/^\s+/" , "", $html );
$html = preg_replace( "#&lt;([^&<>]+)&gt;#" , "&lt;<span style='color:blue'>\\1</span>&gt;" , $html ); //Matches <tag>
$html = preg_replace( "#&lt;([^&<>]+)=#" , "&lt;<span style='color:blue'>\\1</span>=" , $html ); //Matches <tag
$html = preg_replace( "#&\#60;([a-zA-Z0-9]+)([&gt;|\s])#" , "&#60;<span style='color:blue'>\\1</span>\\2" , $html ); //Matches <script[ |>]
$html = preg_replace( "#&lt;([^&<>]+)\s#" , "&lt;<span style='color:blue'>\\1</span> " , $html ); //Matches <tag
$html = preg_replace( "#&lt;/([^&]+)&gt;#" , "&lt;/<span style='color:blue'>\\1</span>&gt;" , $html ); //Matches </tag>
$html = preg_replace( "!=(&quot;|&#39;)(.+?)?(&quot;|&#39;)(\s|&gt;)!" , "=\\1<span style='color:orange'>\\2</span>\\3\\4" , $html ); //Matches ='this'
$html = preg_replace( "!&#60;&#33;--(.+?)--&#62;!" , "&lt;&#33;<span style='color:red'>--\\1--</span>&gt;", $html );
$html = preg_replace( "!&#60;&#33;--(.+?)--&#62;!s" , "&lt;&#33;<span style='color:red'>--\\1--</span>&gt;", $html );
$wrap = $this->wrap_style( 'html' );
@@ -1065,15 +1112,17 @@ class class_bbcode_core
}
$sql = str_replace( "$" , "&#36;", $sql );
//print $sql;exit;
$sql = preg_replace( "#(=|\+|\-|&gt;|&lt;|~|==|\!=|LIKE|NOT LIKE|REGEXP)#i" , "<span style='color:orange'>\\1</span>", $sql );
$sql = preg_replace( "#(MAX|AVG|SUM|COUNT|MIN)\(#i" , "<span style='color:blue'>\\1</span>(" , $sql );
$sql = preg_replace( "#(FROM|INTO)\s{1,}(\S+?)\s{1,}#i" , "<span style='color:green'>\\1</span> <span style='color:orange'>\\2</span> ", $sql );
$sql = preg_replace( "#(FROM|INTO)\s{1,}(\S+?)\s{1,}((\w+)\s{0,})#i" , "<span style='color:green'>\\1</span> <span style='color:orange'>\\2</span> <span style='color:orange'>\\3</span>", $sql );
//$sql = preg_replace( "#,\s{0,}(\S+?)\s{1,}(\w+)\s{0,}#i" , ", <span style='color:orange'>\\2</span> <span style='color:orange'>\\3</span> ", $sql );
$sql = preg_replace( "#(?<=join)\s{1,}(\S+?)\s{1,}(\w+)\s{0,}#i" , " <span style='color:orange'>\\1</span> <span style='color:orange'>\\2</span> ", $sql );
$sql = preg_replace( "!(&quot;|&#39;|&#039;)(.+?)(&quot;|&#39;|&#039;)!i" , "<span style='color:red'>\\1\\2\\3</span>" , $sql );
$sql = preg_replace( "#\s{1,}(AND|OR)\s{1,}#i" , " <span style='color:blue'>\\1</span> " , $sql );
$sql = preg_replace( "#\s{1,}(AND|OR|ON)\s{1,}#i" , " <span style='color:blue'>\\1</span> " , $sql );
$sql = preg_replace( "#(LEFT|JOIN|WHERE|MODIFY|CHANGE|AS|DISTINCT|IN|ASC|DESC|ORDER BY)\s{1,}#i" , "<span style='color:green'>\\1</span> " , $sql );
$sql = preg_replace( "#LIMIT\s*(\d+)\s*,\s*(\d+)#i" , "<span style='color:green'>LIMIT</span> <span style='color:orange'>\\1, \\2</span>" , $sql );
$sql = preg_replace( "#(SELECT|INSERT|UPDATE|DELETE|ALTER TABLE|DROP)#i" , "<span style='color:blue;font-weight:bold'>\\1</span>" , $sql );
$sql = preg_replace( "#LIMIT\s*(\d+)(?:\s*([,])\s*(\d+))*#i" , "<span style='color:green'>LIMIT</span> <span style='color:orange'>\\1\\2 \\3</span>" , $sql );
$sql = preg_replace( "#(SELECT|INSERT|UPDATE|DELETE|ALTER TABLE|CREATE TABLE|DROP)#i" , "<span style='color:blue;font-weight:bold'>\\1</span>" , $sql );
$html = $this->wrap_style( 'sql' );
@@ -1092,7 +1141,12 @@ class class_bbcode_core
*/
function regex_code_tag( $matches=array() )
{
$txt = trim( $matches[1] );
//-----------------------------------------
// We don't want to trim indentations on the first line
//-----------------------------------------
$txt = rtrim( $matches[1] );
$txt = preg_replace( "#^(\n+)(.+?)$#s", "\\2", $txt );
$default = "\[code\]$txt\[/code\]";
@@ -1107,6 +1161,8 @@ class class_bbcode_core
//-----------------------------------------
//$txt = str_replace( "&" , "&amp;", $txt );
$txt = str_replace( "<" , "&#60;" , $txt );
$txt = str_replace( ">" , "&#62;" , $txt );
$txt = str_replace( "&lt;" , "&#60;" , $txt );
$txt = str_replace( "&gt;" , "&#62;" , $txt );
$txt = str_replace( "&quot;" , "&#34;" , $txt );
@@ -1551,20 +1607,20 @@ class class_bbcode_core
$txt = str_replace( chr(173).']', '&#93;', $txt );
// Trim quoted text
$txt = preg_replace_callback( "#\[quote(.+?)?\](.+?)\[/quote\]#si", array( $this, 'regex_trim_quote' ), $txt );
$txt = preg_replace_callback( "#\[quote([^\]]+?)?\](.+?)\[/quote\]#si", array( &$this, 'regex_trim_quote' ), $txt );
// Clean usernames with square brackets
$txt = preg_replace_callback( "#(name=(?:&\#39;|&quot;))(.+?)(&\#39;|&quot;)#si", array( $this, '_make_quote_safe' ), $txt );
$txt = preg_replace_callback( "#(name=(?:&\#39;|&quot;|'|\"))(.+?)(&\#39;|&quot;|'|\")#si", array( &$this, '_make_quote_safe' ), $txt );
$this->quote_html = $this->wrap_style('quote');
$txt = preg_replace_callback( "#\[/quote\]#i" , array( $this, 'regex_close_quote' ) , $txt );
$txt = preg_replace_callback( "#\[quote=([^\],]+?),([^\]]+?)\]#i", array( $this, 'regex_quote_tag' ) , $txt );
$txt = preg_replace_callback( "#\[quote=([^\]]+?)\]#i" , array( $this, 'regex_quote_tag' ) , $txt );
$txt = preg_replace_callback( "#\[quote([^\]]+?)?\]#i" , array( $this, 'regex_simple_quote_tag' ), $txt );
$txt = preg_replace_callback( "#\[/quote\]#i" , array( &$this, 'regex_close_quote' ) , $txt );
$txt = preg_replace_callback( "#\[quote=([^\],]+?),([^\]]+?)\]#i", array( &$this, 'regex_quote_tag' ) , $txt );
$txt = preg_replace_callback( "#\[quote=([^\]]+?)\]#i" , array( &$this, 'regex_quote_tag' ) , $txt );
$txt = preg_replace_callback( "#\[quote([^\]]+?)?\]#i" , array( &$this, 'regex_simple_quote_tag' ), $txt );
$txt = str_replace( "\n", "<br />", $txt );
if ( ($this->quote_open == $this->quote_closed) and ($this->quote_error == 0) )
{
return $txt;
@@ -1616,7 +1672,7 @@ class class_bbcode_core
// INIT
//-----------------------------------------
$extra = $matches[1];
$extra = str_replace( '&apos;', "'", $matches[1] );
$post_id = 0;
$date = '';
$name = '';
@@ -1637,7 +1693,7 @@ class class_bbcode_core
{
$post_id = intval( $match[2] );
}
//-----------------------------------------
// Name?
//-----------------------------------------
@@ -1712,7 +1768,7 @@ class class_bbcode_core
//-----------------------------------------
// Return...
//-----------------------------------------
return "<!--quoteo(post={$post_id}:date={$date}:name={$name})-->{$html['START']}<!--quotec-->";
}
}
@@ -1952,6 +2008,18 @@ class class_bbcode_core
return $url['html'];
}
//-----------------------------------------
// Make sure it's fixed if used in an
// opening quote block
//-----------------------------------------
if ( preg_match( "/(\+\-\-\>)$/", $url['html'], $match) )
{
$url['end'] .= $match[1];
$url['html'] = preg_replace( "/(\+\-\-\>)$/", "", $url['html'] );
$url['show'] = preg_replace( "/(\+\-\-\>)$/", "", $url['show'] );
}
//-----------------------------------------
// clean up the ampersands / brackets
//-----------------------------------------
@@ -2,16 +2,26 @@
/*
+--------------------------------------------------------------------------
| Invision Power Board
| Invision Power Board 2.2.2
| =============================================
| by Matthew Mecham
| (c) 2001 - 2006 Invision Power Services, Inc.
| http://www.invisionpower.com
| =============================================
| Web: http://www.invisionboard.com
| http://www.ibresource.ru/products/invisionpowerboard/
| Time: Monday 05th of March 2007 10:10:54 PM
| Release: e3790216629e5a2aaf37070b32237f06
| Licence Info: http://www.invisionboard.com/?license
| http://www.ibresource.ru/license
+---------------------------------------------------------------------------
| > $Date: 2006-09-22 11:28:54 +0100 (Fri, 22 Sep 2006) $
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
+---------------------------------------------------------------------------
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $Date: 2006-09-22 05:28:54 -0500 (Fri, 22 Sep 2006) $
| > $Revision: 567 $
| > $Author: matt $
+---------------------------------------------------------------------------
@@ -53,8 +63,8 @@
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
exit();
}
class class_bbcode extends class_bbcode_core
+10 -1
View File
@@ -1 +1,10 @@
<html>␍<head><title>Invision Power Board - Bulletin Board System</title></head>␍<body>␍<h1>403: Invision Power Board -> Forbidden</h1>␍<hr>␍You have reached this Page in error, please use␍your back button to return to Invision Board.␍<hr>␍<a href="http://www.invisionboard.com/">Invision Power Board</a>␍</body>␍</html>␍
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1251" />
<meta name="author" content="Êîìïàíèÿ IBResource è Invision Power Services Inc.">
<title>Îøèáêà ðóññêîé âåðñèè Invision Power Board</title>
</head><body>
<h1>Îøèáêà <a href="http://www.ibresource.ru/">ðóññêîé âåðñèè Invision Power Board</a></h1>
<font size="4">Âû ïîïàëè íà íåñóùåñòâóþùóþ ñòðàíèöó!<br>Ïîæàëóéñòà íàæìèòå íà êíîïî÷êó &laquo;<b>Íàçàä</b>&raquo; â&nbsp;âàøåì áðàóçåðå äëÿ âîçâðàùåíèÿ íà ïðåäûäóùóþ ñòðàíèöó.</font>
</body>
</html>