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
+10
View File
@@ -0,0 +1,10 @@
<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>
+21 -7
View File
@@ -26,8 +26,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 plugin_msg
@@ -68,7 +68,7 @@ class plugin_msg
$this->ipsclass->DB->build_query( array( 'select' => 'a.*',
'from' => array( 'attachments' => 'a' ),
'where' => "a.attach_rel_module='".$this->module."' AND a.attach_id=".$attach_id,
'where' => "a.attach_rel_module='".$this->module."' AND a.attach_id=".$attach_id." AND t.mt_owner_id=".$this->ipsclass->member['id'],
'add_join' => array( 0 => array( 'select' => 'p.*',
'from' => array( 'message_text' => 'p' ),
'where' => "p.msg_id=a.attach_rel_id",
@@ -134,19 +134,33 @@ class plugin_msg
$rows = array();
$query = '';
$query_bits = array();
$match = 0;
//-----------------------------------------
// Check
//-----------------------------------------
if ( ! is_array( $attach_ids ) OR ! count( $attach_ids ) )
if ( is_array( $attach_ids ) AND count( $attach_ids ) )
{
$attach_ids = array( -2 );
//$attach_ids = array( -2 );
$query_bits[] = "attach_id IN (" . implode( ",", $attach_ids ) .")";
}
if ( is_array( $rel_ids ) and count( $rel_ids ) )
{
$query = " OR attach_rel_id IN (-1," . implode( ",", $rel_ids ) . ")";
$query_bits[] = "attach_rel_id IN (" . implode( ",", $rel_ids ) . ")";
//$query = " OR attach_rel_id IN (-1," . implode( ",", $rel_ids ) . ")";
$match = 1;
}
if( !count($query_bits) )
{
$query = "attach_id IN (-1)";
}
else
{
$query = implode( " OR ", $query_bits );
}
//-----------------------------------------
@@ -155,7 +169,7 @@ class plugin_msg
$this->ipsclass->DB->build_query( array( 'select' => '*',
'from' => 'attachments',
'where' => "attach_rel_module='".$this->module."' AND ( attach_id IN(-1,". implode( ",", $attach_ids ) . ") " . $query . " )",
'where' => "attach_rel_module='".$this->module."' AND ( " . $query . " )",
) );
$attach_sql = $this->ipsclass->DB->exec_query();
+39 -13
View File
@@ -26,8 +26,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 plugin_post
@@ -62,6 +62,11 @@ class plugin_post
$_ok = 0;
if( !$attach_id )
{
return FALSE;
}
//-----------------------------------------
// Grab 'em
//-----------------------------------------
@@ -89,8 +94,11 @@ class plugin_post
if ( ! isset( $attach['pid'] ) OR empty( $attach['pid'] ) )
{
if( $attach['attach_member_id'] != $this->ipsclass->member['id'] )
{
return FALSE;
}
}
//-----------------------------------------
// Queued post?
@@ -180,6 +188,7 @@ class plugin_post
//-----------------------------------------
$rows = array();
$query_bits = array();
$query = '';
$match = 0;
@@ -187,30 +196,41 @@ class plugin_post
// Check
//-----------------------------------------
if ( ! is_array( $attach_ids ) OR ! count( $attach_ids ) )
if ( is_array( $attach_ids ) AND count( $attach_ids ) )
{
$attach_ids = array( -2 );
$query_bits[] = "attach_id IN (" . implode( ",", $attach_ids ) .")";
}
if ( is_array( $rel_ids ) and count( $rel_ids ) )
{
$query = " OR attach_rel_id IN (-1," . implode( ",", $rel_ids ) . ")";
$query_bits[] = "attach_rel_id IN (" . implode( ",", $rel_ids ) . ")";
//$query = " OR attach_rel_id IN (-1," . implode( ",", $rel_ids ) . ")";
$match = 1;
}
if ( $attach_post_key )
{
$query .= " OR attach_post_key='".$this->ipsclass->DB->add_slashes( $attach_post_key )."'";
$query_bits[] = "attach_post_key='".$this->ipsclass->DB->add_slashes( $attach_post_key )."'";
//$query .= " OR attach_post_key='".$this->ipsclass->DB->add_slashes( $attach_post_key )."'";
$match = 2;
}
if( !count($query_bits) )
{
$query = "attach_id IN (-1)";
}
else
{
$query = implode( " OR ", $query_bits );
}
//-----------------------------------------
// Grab 'em
//-----------------------------------------
$this->ipsclass->DB->build_query( array( 'select' => '*',
'from' => 'attachments',
'where' => "attach_rel_module='".$this->module."' AND ( attach_id IN(-1,". implode( ",", $attach_ids ) . ") " . $query . " )",
'where' => "attach_rel_module='".$this->module."' AND ( " . $query . " )",
) );
$attach_sql = $this->ipsclass->DB->exec_query();
@@ -448,7 +468,7 @@ class plugin_post
{
$this->ipsclass->DB->build_query( array( 'select' => 'p.pid',
'from' => array( 'posts' => 'p' ),
'where' => 'p.pid='. intval( $attach['attach_rel_id'] ),
'where' => 'p.pid='. intval( $attachment['attach_rel_id'] ),
'add_join' => array( 0 => array( 'select' => 't.forum_id, t.tid',
'from' => array( 'topics' => 't' ),
'where' => 't.tid=p.topic_id',
@@ -542,8 +562,6 @@ class plugin_post
// Generate space allowed figure
//-----------------------------------------
if ( $this->ipsclass->member['g_attach_max'] > 0 )
{
if ( $this->ipsclass->member['g_attach_per_post'] )
{
//-----------------------------------------
@@ -555,8 +573,6 @@ class plugin_post
'where' => "attach_post_key='".$post_key."'" ) );
$space_used = intval( $_space_used['figure'] );
$space_allowed = intval( ( $this->ipsclass->member['g_attach_per_post'] * 1024 ) - $space_used );
$space_allowed = $space_allowed < 0 ? 0 : $space_allowed;
}
else
{
@@ -569,9 +585,19 @@ class plugin_post
'where' => 'attach_member_id='.$member_id ) );
$space_used = intval( $_space_used['figure'] );
}
if ( $this->ipsclass->member['g_attach_max'] > 0 )
{
if ( $this->ipsclass->member['g_attach_per_post'] )
{
$space_allowed = intval( ( $this->ipsclass->member['g_attach_per_post'] * 1024 ) - $space_used );
$space_allowed = $space_allowed < 0 ? 0 : $space_allowed;
}
else
{
$space_allowed = intval( ( $this->ipsclass->member['g_attach_max'] * 1024 ) - $space_used );
$space_allowed = $space_allowed < 0 ? 0 : $space_allowed;
}
}
else
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>
-294
View File
@@ -1,294 +0,0 @@
<?php
/*
+--------------------------------------------------------------------------
| Invision Power Board
| =============================================
| by Matthew Mecham
| (c) 2001 - 2006 Invision Power Services, Inc.
| http://www.invisionpower.com
| =============================================
| Web: http://www.invisionboard.com
| Licence Info: http://www.invisionboard.com/?license
+---------------------------------------------------------------------------
| > $Date: 2006-08-01 17:02:55 +0100 (Tue, 01 Aug 2006) $
| > $Revision: 425 $
| > $Author: matt $
+---------------------------------------------------------------------------
|
| > AJAX Functions
| > Module written by Matt Mecham
| > Date started: Wednesday 2nd August 2006
|
+--------------------------------------------------------------------------
*/
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();
}
class class_ajax
{
/**
* Global IPS class
*/
var $ipsclass;
/**
* XML output
*/
var $xml_output;
/**
* XML Header
*/
var $xml_header;
/**
* Character sets
*/
var $decode_charsets = array( 'iso-8859-1' => 'ISO-8859-1',
'iso8859-1' => 'ISO-8859-1',
'iso-8859-15' => 'ISO-8859-15',
'iso8859-15' => 'ISO-8859-15',
'utf-8' => 'UTF-8',
'cp866' => 'cp866',
'ibm866' => 'cp866',
'cp1251' => 'windows-1251',
'windows-1251' => 'windows-1251',
'win-1251' => 'windows-1251',
'cp1252' => 'windows-1252',
'windows-1252' => 'windows-1252',
'koi8-r' => 'KOI8-R',
'koi8-ru' => 'KOI8-R',
'koi8r' => 'KOI8-R',
'big5' => 'BIG5',
'gb2312' => 'GB2312',
'big5-hkscs' => 'BIG5-HKSCS',
'shift_jis' => 'Shift_JIS',
'sjis' => 'Shift_JIS',
'euc-jp' => 'EUC-JP',
'eucjp' => 'EUC-JP' );
/*-------------------------------------------------------------------------*/
// Initialize the class
/*-------------------------------------------------------------------------*/
/**
* INIT the class
*/
function class_init()
{
$this->xml_header = "<?xml version=\"1.0\" encoding=\"{$this->ipsclass->vars['gb_char_set']}\"?".'>';
}
/*-------------------------------------------------------------------------*/
// make string XML safe
/*-------------------------------------------------------------------------*/
/**
* Make a string safe for XML transport
*/
function _make_safe_for_xml( $t )
{
return str_replace( '&amp;#39;', '&#39;', htmlspecialchars( $t ) );
}
/*-------------------------------------------------------------------------*/
// Error handler
/*-------------------------------------------------------------------------*/
/**
* Print an error
*/
function error_handler()
{
@header( "Content-type: text/xml" );
$this->print_nocache_headers();
$this->xml_output = $this->xml_header."\r\n<errors>\r\n";
$this->xml_output .= "<error><message>You must be logged in to access this feature</message></error>\r\n";
$this->xml_output .= "</errors>";
print $this->xml_output;
exit();
}
/*-------------------------------------------------------------------------*/
// Return NOTHING :o
/*-------------------------------------------------------------------------*/
/**
* Return a NULL result
*/
function return_null($val=0)
{
@header( "Content-type: text/xml" );
$this->print_nocache_headers();
print $this->xml_header."\r\n<null>{$val}</null>";
exit();
}
/*-------------------------------------------------------------------------*/
// Return string
/*-------------------------------------------------------------------------*/
/**
* Return a string
*/
function return_string($string)
{
@header( "Content-type: text/plain" );
$this->print_nocache_headers();
print $string;
exit();
}
/*-------------------------------------------------------------------------*/
// Return HTML
/*-------------------------------------------------------------------------*/
/**
* Return a HTML
*/
function return_html($string)
{
//-----------------------------------------
// Stop one from removing cookie protection
//-----------------------------------------
$string = ( $string ) ? $string : '<!--nothing-->';
$string = preg_replace( "#htmldocument\.prototype#is", "HTMLDocument_prototype", $string );
// Fix IE bugs
$string = str_replace( "&sect", "&amp;sect", $string );
$string = str_replace( "ì", "&#8220;", $string );
$string = str_replace( "î", "&#8221;", $string );
// Other stuff
$string = str_replace( "<#IMG_DIR#>", $this->ipsclass->skin['_imagedir'], $string );
$string = str_replace( "<#EMO_DIR#>", $this->ipsclass->skin['_emodir'] , $string );
@header( "Content-type: text/html;charset=".$this->ipsclass->vars['gb_char_set'] );
$this->print_nocache_headers();
print $string;
exit();
}
/*-------------------------------------------------------------------------*/
// Print no cache headers
/*-------------------------------------------------------------------------*/
/**
* Print nocache headers
*/
function print_nocache_headers()
{
header("HTTP/1.0 200 OK");
header("HTTP/1.1 200 OK");
header("Cache-Control: no-cache, must-revalidate, max-age=0");
header("Expires: 0");
header("Pragma: no-cache");
}
/*-------------------------------------------------------------------------*/
// Convert decimal character references to UTF-8
/*-------------------------------------------------------------------------*/
/**
* Convert a decimal character to UTF-8
*/
function dec_char_ref_to_utf8($int=0)
{
$return = '';
if ( $int < 0 )
{
return chr(0);
}
else if ( $int <= 0x007f )
{
$return .= chr($int);
}
else if ( $int <= 0x07ff )
{
$return .= chr(0xc0 | ($int >> 6));
$return .= chr(0x80 | ($int & 0x003f));
}
else if ( $int <= 0xffff )
{
$return .= chr(0xe0 | ($int >> 12));
$return .= chr(0x80 | (($int >> 6) & 0x003f));
$return .= chr(0x80 | ($int & 0x003f));
}
else if ( $int <= 0x10ffff )
{
$return .= chr(0xf0 | ($int >> 18));
$return .= chr(0x80 | (($int >> 12) & 0x3f));
$return .= chr(0x80 | (($int >> 6) & 0x3f));
$return .= chr(0x80 | ($int & 0x3f));
}
else
{
return chr(0);
}
return $return;
}
/*-------------------------------------------------------------------------*/
// Helper function
/*-------------------------------------------------------------------------*/
function dec_char_ref_to_utf8_hexdec( $matches )
{
return $this->dec_char_ref_to_utf8( hexdec( $matches[1] ) );
}
/*-------------------------------------------------------------------------*/
// Convert Ajax unicode
/*-------------------------------------------------------------------------*/
function convert_unicode($t)
{
if ( strtolower($this->ipsclass->vars['gb_char_set']) == 'utf-8' )
{
return preg_replace_callback( '#%u([0-9A-F]{1,4})#i', array( $this, 'dec_char_ref_to_utf8_hexdec' ), utf8_encode($t) );
}
else
{
return preg_replace_callback( '#%u([0-9A-F]{1,4})#i', create_function( '$matches', "return '&#' . hexdec(\$matches[1]) . ';';" ), $t );
}
}
/**
* Convert HTML entities and respect character sets
*/
function convert_html_entities($t)
{
//-----------------------------------------
// Try and fix up HTML entities with missing ;
//-----------------------------------------
$t = preg_replace( "/&#(\d+?)([^\d;])/i", "&#\\1;\\2", $t );
//-----------------------------------------
// Continue...
//-----------------------------------------
if ( strtolower($this->ipsclass->vars['gb_char_set']) != 'iso-8859-1' &&
strtolower($this->ipsclass->vars['gb_char_set']) != 'utf-8' )
{
if ( array_key_exists( strtolower($this->ipsclass->vars['gb_char_set']), $this->decode_charsets ) )
{
$this->ipsclass->vars['gb_char_set'] = $this->decode_charsets[strtolower($this->ipsclass->vars['gb_char_set'])];
$t = html_entity_decode( $t, ENT_NOQUOTES, $this->ipsclass->vars['gb_char_set'] );
}
else
{
// Take a crack at entities in other character sets
$t = str_replace( "&amp;#", "&#", $t );
}
}
return $t;
}
}
?>
-695
View File
@@ -1,695 +0,0 @@
<?php
/*
+---------------------------------------------------------------------------
| Invision Power Dynamic v1.0.0
| ========================================
| by Matthew Mecham
| (c) 2004 Invision Power Services
| http://www.invisionpower.com
| ========================================
+---------------------------------------------------------------------------
| INVISION POWER DYNAMIC IS NOT FREE SOFTWARE!
| http://www.invisionpower.com/dynamic/
+---------------------------------------------------------------------------
| > $Id$
| > $Revision: 128 $
| > $Date: 2006-01-20 12:46:26 +0000 (Fri, 20 Jan 2006) $
+---------------------------------------------------------------------------
|
| > CAPTCHA ANTI-SPAM CLASS
| > Script written by Matt Mecham
| > Date started: Thursday 2 February (11:08)
|
+---------------------------------------------------------------------------
*/
/**
* CAPTCHA CLASS
* ipsclass dependent method of showing an anti-spam image
*
* This creates a unique MD5 hash and stores it in the DB with
* an 8 character string of 0-9a-z
*
* <code>
* CREATE TABLE captcha (
* captcha_unique_id VARCHAR(32) NOT NULL default '',
* captcha_string VARCHAR(100) NOT NULL default '',
* captcha_ipaddress VARCHAR(16) NOT NULL default '',
* captcha_date INT(10) NOT NULL default '',
* PRIMARY KEY (captcha_unique_id )
* );
* </code>
* @package IPDYNAMIC
* @author Matt Mecham
* @copyright Invision Power Services, Inc.
* @version 1.0
*/
class class_captcha
{
/**
* Global IPS class array
* @var object
*/
var $ipsclass;
/**
* GD version
* @var integer
*/
var $gd_version = 0;
/*-------------------------------------------------------------------------*/
// Initializes captcha session
/*-------------------------------------------------------------------------*/
/**
* Initializes captcha session
* Clears out "dead" entries, adds new row and returns
* unique ID for use in an image
*
* @return string Captcha unique ID
*/
function captcha_create_session()
{
//-----------------------------------------
// Clear old
//-----------------------------------------
$this->captcha_clear_sessions( $this->ipsclass->ip_address );
//-----------------------------------------
// Create new ID
//-----------------------------------------
$captcha_unique_id = md5( uniqid( time() ) );
$captcha_string = "";
//-----------------------------------------
// Create new string
//-----------------------------------------
mt_srand( (double) microtime() * 1000000 );
$final_rand = md5( uniqid( mt_rand(), TRUE ) );
mt_srand();
for( $i = 0; $i < 8; $i++ )
{
$captcha_string .= $final_rand{ mt_rand(0, 31) };
}
//-----------------------------------------
// Add to the DB
//-----------------------------------------
$this->ipsclass->DB->do_insert( 'captcha', array( 'captcha_unique_id' => $captcha_unique_id,
'captcha_string' => $captcha_string,
'captcha_ipaddress' => $this->ipsclass->ip_address,
'captcha_date' => time() ) );
//-----------------------------------------
// Return ID
//-----------------------------------------
return $captcha_unique_id;
}
/*-------------------------------------------------------------------------*/
// Captcha validate
/*-------------------------------------------------------------------------*/
/**
* Show the captcha bot image
*
* @param string captcha_unique_id The captcha DB row
* @param string captcha_input The user entered data
* @return void
* @since 1.0
*/
function captcha_validate( $captcha_unique_id, $captcha_input )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$captcha_input = trim( strtolower($captcha_input) );
//-----------------------------------------
// Get the info from the DB
//-----------------------------------------
$captcha = $this->ipsclass->DB->build_and_exec_query( array( 'select' => '*',
'from' => 'captcha',
'where' => "captcha_unique_id='".$captcha_unique_id."'" ) );
if ( ! $captcha['captcha_unique_id'] )
{
return FALSE;
}
//-----------------------------------------
// Check...
//-----------------------------------------
if ( $captcha['captcha_string'] != $captcha_input )
{
return FALSE;
}
else
{
return TRUE;
}
}
/*-------------------------------------------------------------------------*/
// Captcha show image
/*-------------------------------------------------------------------------*/
/**
* Show the captcha bot image
*
* @param string captcha_unique_id
* @return void
* @since 1.0
*/
function captcha_show_image( $captcha_unique_id )
{
//-----------------------------------------
// CHECK
//-----------------------------------------
if ( ! $captcha_unique_id )
{
return FALSE;
}
//-----------------------------------------
// Get the info from the DB
//-----------------------------------------
$captcha = $this->ipsclass->DB->build_and_exec_query( array( 'select' => '*',
'from' => 'captcha',
'where' => "captcha_unique_id='".$captcha_unique_id."'" ) );
if ( ! $captcha['captcha_unique_id'] )
{
return FALSE;
}
//-----------------------------------------
// Show it...
//-----------------------------------------
$this->captcha_show_gd_img( $captcha['captcha_string'] );
}
/*-------------------------------------------------------------------------*/
// Show GD created security image...
/*-------------------------------------------------------------------------*/
/**
* Show anti-spam bot GD image numbers
*
* @param string Number string
* @return void
* @since 1.0
*/
function captcha_show_gd_img( $content="" )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$content = ' '. preg_replace( "/(\w)/", "\\1 ", $content ) .' ';
$allow_fonts = 1;
$use_fonts = 0;
$tmp_x = 135;
$tmp_y = 20;
$image_x = 200;
$image_y = 60;
$circles = 3;
$continue_loop = TRUE;
$_started = FALSE;
//-----------------------------------------
// Get backgrounds and fonts...
//-----------------------------------------
$backgrounds = $this->_captcha_show_gd_img_get_backgrounds();
$fonts = $this->_captcha_show_gd_img_get_fonts();
//-----------------------------------------
// Seed rand functions for PHP versions that don't
//-----------------------------------------
mt_srand( (double) microtime() * 1000000 );
//-----------------------------------------
// Got a background?
//-----------------------------------------
if ( $this->ipsclass->vars['gd_version'] > 1 )
{
while ( $continue_loop )
{
if ( is_array( $backgrounds ) AND count( $backgrounds ) )
{
$i = mt_rand(0, count( $backgrounds ) - 1 );
$background = $backgrounds[ $i ];
$_file_extension = preg_replace( "#^.*\.(\w{2,4})$#is", "\\1", strtolower( $background ) );
switch( $_file_extension )
{
case 'jpg':
case 'jpe':
case 'jpeg':
if ( ! function_exists('imagecreatefromjpeg') OR ! $im = @imagecreatefromjpeg($background) )
{
unset( $backgrounds[ $i ] );
}
else
{
$continue_loop = FALSE;
$_started = TRUE;
}
break;
case 'gif':
if ( ! function_exists('imagecreatefromgif') OR ! $im = @imagecreatefromgif($background) )
{
unset( $backgrounds[ $i ] );
}
else
{
$continue_loop = FALSE;
$_started = TRUE;
}
break;
case 'png':
if ( ! function_exists('imagecreatefrompng') OR ! $im = @imagecreatefrompng($background) )
{
unset( $backgrounds[ $i ] );
}
else
{
$continue_loop = FALSE;
$_started = TRUE;
}
break;
}
}
else
{
$continue_loop = FALSE;
}
}
}
//-----------------------------------------
// Still not got one? DO OLD FASHIONED
//-----------------------------------------
if ( $_started !== TRUE )
{
if ( $this->ipsclass->vars['gd_version'] == 1 )
{
$im = imagecreate($image_x, $image_y);
$tmp = imagecreate($tmp_x, $tmp_y);
}
else
{
$im = imagecreatetruecolor($image_x, $image_y);
$tmp = imagecreatetruecolor($tmp_x, $tmp_y);
}
$white = ImageColorAllocate($tmp, 255, 255, 255);
$black = ImageColorAllocate($tmp, 0, 0, 0);
$grey = ImageColorAllocate($tmp, 200, 200, 200 );
imagefill($tmp, 0, 0, $white);
for ( $i = 1; $i <= $circles; $i++ )
{
$values = array(
0 => rand(0, $tmp_x - 10),
1 => rand(0, $tmp_y - 3),
2 => rand(0, $tmp_x - 10),
3 => rand(0, $tmp_y - 3),
4 => rand(0, $tmp_x - 10),
5 => rand(0, $tmp_y - 3),
6 => rand(0, $tmp_x - 10),
7 => rand(0, $tmp_y - 3),
8 => rand(0, $tmp_x - 10),
9 => rand(0, $tmp_y - 3),
10 => rand(0, $tmp_x - 10),
11 => rand(0, $tmp_y - 3),
);
$randomcolor = imagecolorallocate( $tmp, rand(100,255), rand(100,255),rand(100,255) );
imagefilledpolygon($tmp, $values, 6, $randomcolor );
}
$num = strlen($content);
$x_param = 0;
$y_param = 0;
for( $i = 0; $i < $num; $i++ )
{
$x_param += rand(6,12);
$y_param = rand(-3,8);
$randomcolor = imagecolorallocate( $tmp, rand(0,150), rand(0,150),rand(0,150) );
imagestring($tmp, 5, $x_param+1, $y_param+1, $content{$i}, $grey);
imagestring($tmp, 5, $x_param, $y_param, $content{$i}, $randomcolor);
}
//-----------------------------------------
// Distort by resizing
//-----------------------------------------
imagecopyresized($im, $tmp, 0, 0, 0, 0, $image_x, $image_y, $tmp_x, $tmp_y);
imagedestroy($tmp);
//-----------------------------------------
// Background dots and lines
//-----------------------------------------
$random_pixels = $image_x * $image_y / 10;
for ($i = 0; $i < $random_pixels; $i++)
{
$randomcolor = imagecolorallocate( $im, rand(0,150), rand(0,150),rand(0,150) );
ImageSetPixel($im, rand(0, $image_x), rand(0, $image_y), $randomcolor);
}
$no_x_lines = ($image_x - 1) / 5;
for ( $i = 0; $i <= $no_x_lines; $i++ )
{
ImageLine( $im, $i * $no_x_lines, 0, $i * $no_x_lines, $image_y, $grey );
ImageLine( $im, $i * $no_x_lines, 0, ($i * $no_x_lines)+$no_x_lines, $image_y, $grey );
}
$no_y_lines = ($image_y - 1) / 5;
for ( $i = 0; $i <= $no_y_lines; $i++ )
{
ImageLine( $im, 0, $i * $no_y_lines, $image_x, $i * $no_y_lines, $grey );
}
}
else
{
//-----------------------------------------
// Can we use fonts?
//-----------------------------------------
if ( $allow_fonts AND function_exists('imagettftext') AND is_array( $fonts ) AND count( $fonts ) )
{
imageantialias( $im, TRUE );
$num = strlen($content);
$x_param = -18;
$y_param = 0;
$_font = $fonts[ mt_rand( 0, count( $fonts ) - 1 ) ];
for( $i = 0; $i < $num; $i++ )
{
$y_param = rand( 35, 48 );
# Main color
$col_r = rand(50,200);
$col_g = rand(0,150);
$col_b = rand(50,200);
# High light
$col_r_l = ( $col_r + 50 > 255 ) ? 255 : $col_r + 50;
$col_g_l = ( $col_g + 50 > 255 ) ? 255 : $col_g + 50;
$col_b_l = ( $col_b + 50 > 255 ) ? 255 : $col_b + 50;
# Low light
$col_r_d = ( $col_r - 50 < 0 ) ? 0 : $col_r - 50;
$col_g_d = ( $col_g - 50 < 0 ) ? 0 : $col_g - 50;
$col_b_d = ( $col_b - 50 < 0 ) ? 0 : $col_b - 50;
$color_main = imagecolorallocate( $im, $col_r, $col_g, $col_b );
$color_light = imagecolorallocate( $im, $col_r_l, $col_g_l, $col_b_l );
$color_dark = imagecolorallocate( $im, $col_r_d, $col_g_d, $col_b_d );
$_slant = mt_rand( -20, 40 );
if ( $i == 1 OR $i == 3 OR $i == 5 )
{
for( $ii = 0 ; $ii < 2 ; $ii++ )
{
$a = $x_param + 50;
$b = mt_rand(0,100);
$c = $a + 20;
$d = $b + 20;
$e = ( $i == 3 ) ? mt_rand( 280, 320 ) : mt_rand( -280, -320 );
imagearc( $im, $a , $b , $c, $d, 0, $e, $color_light );
imagearc( $im, $a+1, $b+1, $c, $d, 0, $e, $color_main );
}
}
if ( ! $_result = @imagettftext( $im, 24, $_slant, $x_param - 1, $y_param - 1, $color_light, $_font, $content{$i} ) )
{
$use_fonts = FALSE;
break;
}
else
{
@imagettftext( $im, 24, $_slant, $x_param + 1, $y_param + 1, $color_dark, $_font, $content{$i} );
@imagettftext( $im, 24, $_slant, $x_param, $y_param, $color_main, $_font, $content{$i} );
}
$x_param += rand( 15, 18 );
}
$use_fonts = TRUE;
}
if ( ! $use_fonts )
{
//-----------------------------------------
// Continue with nice background image
//-----------------------------------------
$tmp = imagecreatetruecolor($tmp_x , $tmp_y );
$tmp2 = imagecreatetruecolor($image_x, $image_y);
$white = imagecolorallocate( $tmp, 255, 255, 255 );
$black = imagecolorallocate( $tmp, 0, 0, 0 );
$grey = imagecolorallocate( $tmp, 100, 100, 100 );
$transparent = imagecolorallocate( $tmp2, 255, 255, 255 );
$_white = imagecolorallocate( $tmp2, 255, 255, 255 );
imagefill($tmp , 0, 0, $white );
imagefill($tmp2, 0, 0, $_white);
$num = strlen($content);
$x_param = 0;
$y_param = 0;
for( $i = 0; $i < $num; $i++ )
{
if ( $i > 0 )
{
$x_param += rand( 6, 12 );
}
$y_param = rand( 0, 5 );
$randomcolor = imagecolorallocate( $tmp, rand(50,200), rand(50,200),rand(50,200) );
imagestring( $tmp, 5, $x_param + 1, $y_param + 1, $content{$i}, $grey );
imagestring( $tmp, 5, $x_param , $y_param , $content{$i}, $randomcolor );
}
imagecopyresized($tmp2, $tmp, 0, 0, 0, 0, $image_x, $image_y, $tmp_x, $tmp_y );
$tmp2 = $this->captcha_show_gd_img_wave( $tmp2, 8, true );
imagecolortransparent( $tmp2, $transparent );
imagecopymerge( $im, $tmp2, 0, 0, 0, 0, $image_x, $image_y, 100 );
imagedestroy($tmp);
imagedestroy($tmp2);
}
}
//-----------------------------------------
// Blur?
//-----------------------------------------
if ( function_exists( 'imagefilter' ) )
{
@imagefilter( $im, IMG_FILTER_GAUSSIAN_BLUR );
}
//-----------------------------------------
// Render a border
//-----------------------------------------
$black = imagecolorallocate( $im, 0, 0, 0 );
imageline( $im, 0, 0, $image_x, 0, $black );
imageline( $im, 0, 0, 0, $image_y, $black );
imageline( $im, $image_x - 1, 0, $image_x - 1, $image_y, $black );
imageline( $im, 0, $image_y - 1, $image_x, $image_y - 1, $black );
//-----------------------------------------
// Show it!
//-----------------------------------------
@header( "Content-Type: image/jpeg" );
imagejpeg( $im );
imagedestroy( $im );
exit();
}
/*-------------------------------------------------------------------------*/
// Create wave effect for GD images...
/*-------------------------------------------------------------------------*/
/**
* Create wave effect for GD images
*
* @param object Image resource
* @return object Returned image resource
* @since 1.0
*/
function captcha_show_gd_img_wave( $im, $wave=10 )
{
$_width = imagesx( $im );
$_height = imagesy( $im );
$tmp = imagecreatetruecolor( $_width, $_height );
$_direction = ( time() % 0 ) ? TRUE : FALSE;
for ( $x = 0; $x < $_width; $x++ )
{
for ( $y = 0 ; $y < $_height ; $y++ )
{
$xo = $wave * sin( 2 * 3.1415 * $y / 128 );
$yo = $wave * cos( 2 * 3.1415 * $x / 128 );
$_x = $x - $xo;
$_y = $y - $yo;
if ( ($_x > 0 AND $_x < $_width) AND ($_y > 0 AND $_y < $_height) )
{
$index = imagecolorat($im, $_x, $_y);
$colors = imagecolorsforindex($im, $index);
$color = imagecolorresolve( $tmp, $colors['red'], $colors['green'], $colors['blue'] );
}
else
{
$color = imagecolorresolve( $tmp, 255, 255, 255 );
}
imagesetpixel( $tmp, $x, $y, $color );
}
}
return $tmp;
}
/*-------------------------------------------------------------------------*/
// Removes extinct captcha sessions
/*-------------------------------------------------------------------------*/
/**
* Removes extinct captcha sessions
* Clears out "dead" entries
*
* @param string Optional IP address to clear out on
* @return string void
*/
function captcha_clear_sessions( $ip_address='' )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$time = time() - 60 * 3600;
$extra = ( $ip_address ) ? ' OR captcha_ipaddress="'.$ip_address.'"' : '';
//-----------------------------------------
// Remove...
//-----------------------------------------
$this->ipsclass->DB->build_and_exec_query( array( 'delete' => 'captcha',
'where' => 'captcha_date < ' . $time . $extra ) );
}
/*-------------------------------------------------------------------------*/
// Load up the backgrounds
/*-------------------------------------------------------------------------*/
/**
* Loads up the backgrounds.
*
* @return array backgrounds
*/
function _captcha_show_gd_img_get_backgrounds()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$images = array();
$_path = ROOT_PATH . 'style_captcha/captcha_backgrounds';
if ( $_dir = @opendir( $_path ) )
{
while( $_file = @readdir( $_dir ) )
{
if ( preg_match( "#\.(gif|jpeg|jpg|png)$#i", $_file ) )
{
$images[] = $_path . '/' . $_file;
}
}
}
return $images;
}
/*-------------------------------------------------------------------------*/
// Load up the fonts
/*-------------------------------------------------------------------------*/
/**
* Loads up the fonts.
*
* @return array fonts
*/
function _captcha_show_gd_img_get_fonts()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$fonts = array();
$_path = ROOT_PATH . 'style_captcha/captcha_fonts';
if ( $_dir = @opendir( $_path ) )
{
while( $_file = @readdir( $_dir ) )
{
if ( preg_match( "#\.(ttf)$#i", $_file ) )
{
$fonts[] = $_path . '/' . $_file;
}
}
}
return $fonts;
}
}
?>
+14 -4
View File
@@ -1,16 +1,26 @@
<?php
/*
+--------------------------------------------------------------------------
| 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 $
+---------------------------------------------------------------------------
@@ -34,8 +44,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 custom_fields
+33 -18
View File
@@ -1,17 +1,27 @@
<?php
/*
+--------------------------------------------------------------------------
| 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-11 13:55:47 +0100 (Wed, 11 Oct 2006) $
| > $Revision: 624 $
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
+---------------------------------------------------------------------------
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $Date: 2006-12-05 09:12:45 -0600 (Tue, 05 Dec 2006) $
| > $Revision: 765 $
| > $Author: matt $
+---------------------------------------------------------------------------
|
@@ -26,7 +36,7 @@
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.";
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
exit();
}
@@ -155,9 +165,9 @@ class display {
{
$copyright = "<!-- Copyright Information -->
<div align='center' style='background-color:#FFF;color:#000;font-size:11px;width:auto;'>
Powered by: <a href='http://www.invisionboard.com' target='_blank' style='color:#000'>Invision Power Board</a> (Free Trial)
Ðàáîòàåò íà <a href='http://www.ibresource.ru/' style='text-decoration:none' target='_blank'>ðóññêîé âåðñèè</a> <a href='http://www.invisionboard.com' target='_blank' style='color:#000'>Invision Power Board</a> (Free Trial)
{$version} &copy; ".date("Y")." &nbsp;<a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
<br /><strong>Get your free trial <a href='http://www.invisionboard.com' target='_blank' style='text-decoration:underline;color:#000'>here!</a></strong>
<br /><strong>Ñêà÷àéòå òðèàë-âåðñèþ <a href='http://www.invisionboard.com' target='_blank' style='text-decoration:underline;color:#000'>òóò!</a></strong>
</div>
<!-- / Copyright -->";
}
@@ -165,13 +175,13 @@ class display {
{
$copyright = "<!-- Copyright Information -->
<div align='center' class='copyright'>
<a href='http://www.invisionboard.com' style='text-decoration:none' target='_blank'>Invision Power Board</a>
{$version} &copy; ".date("Y")." &nbsp;IPS, Inc.
<a href='http://www.ibresource.ru/' style='text-decoration:none' target='_blank'>Ðóññêàÿ âåðñèÿ</a> <a href='http://www.invisionboard.com' style='text-decoration:none' target='_blank'>IP.Board</a>
{$version} &copy; ".date("Y")." &nbsp;<a href='http://www.invisionpower.com' style='text-decoration:none' target='_blank'>IPS, Inc</a>.
";
if ( $this->ipsclass->vars['ipb_reg_show'] and $this->ipsclass->vars['ipb_reg_name'] )
{
$copyright .= "<div>Licensed to: ". $this->ipsclass->vars['ipb_reg_name']."</div>";
$copyright .= "<div>".$this->ipsclass->lang['licensed_to']. $this->ipsclass->vars['ipb_reg_name']."</div>";
}
@@ -208,7 +218,7 @@ class display {
if ( $data['com_url_title'] AND $data['com_url_uri'] )
{
$data['com_url_uri'] = str_replace( '{ipb.base_url}' , $this->ipsclass->base_url , $data['com_url_uri'] );
$data['com_url_title'] = preg_replace_callback( '#{ipb.lang\[[\'"](.+?)[\'"]\]}#i', array( $this, '_return_lang_var' ), $data['com_url_title'] );
$data['com_url_title'] = preg_replace_callback( '#{ipb.lang\[[\'"](.+?)[\'"]\]}#i', array( &$this, '_return_lang_var' ), $data['com_url_title'] );
$components_links .= $this->ipsclass->compiled_templates['skin_global']->global_board_header_component_link( $data['com_url_uri'],$data['com_url_title'], $data );
}
@@ -301,6 +311,11 @@ class display {
// Basics
//-----------------------------------------
if( strstr( strtolower(PHP_OS), 'win' ) )
{
$this->ipsclass->server_load = $this->ipsclass->server_load . '%';
}
if ( $this->ipsclass->member['id'] and $this->ipsclass->vars['debug_level'] )
{
$quickstats = $this->ipsclass->compiled_templates['skin_global']->global_quick_stats($this->ex_time, $gzip_status, $this->ipsclass->server_load, $this->ipsclass->DB->get_query_cnt() );
@@ -1026,13 +1041,13 @@ class display {
{
$collapsed_ids = ','.$this->ipsclass->my_getcookie('collapseprefs').',';
$show['div_fo'] = 'show';
$show['div_fo'] = '';
$show['div_fc'] = 'none';
if ( strstr( $collapsed_ids, ',debug,' ) )
{
$show['div_fo'] = 'none';
$show['div_fc'] = 'show';
$show['div_fc'] = '';
}
$stats = "<div align='center' style='display:{$show['div_fc']}' id='fc_debug'>
@@ -1105,12 +1120,12 @@ class display {
{
$latest_version = $this->ipsclass->DB->build_and_exec_query( array( 'select' => '*', 'from' => 'upgrade_history', 'order' => 'upgrade_version_id DESC', 'limit' => array(0, 1) ) );
if ( $this->ipsclass->version == 'v<{%dyn.down.var.human.version%}>' )
if ( $this->ipsclass->version == 'v2.2.2' )
{
$this->ipsclass->version = 'v'.$latest_version['upgrade_version_human'];
}
if ( $this->ipsclass->acpversion == '<{%dyn.down.var.long_version_id%}>' )
if ( $this->ipsclass->acpversion == '22011' )
{
$this->ipsclass->acpversion = $latest_version['upgrade_version_id'];
}
@@ -1118,7 +1133,7 @@ class display {
list( $cust_number, $acc_number ) = explode( ',', $cust_number_tmp );
@header( "Content-type: text/xml" );
$out = '<?xml version="1.0" encoding="ISO-8859-1"?'.'>';
$out = '<?xml version="1.0" encoding="WINDOWS-1251"?'.'>';
$out .= "\n<ipscheck>\n\t<result>1</result>\n\t<customer_id>$cust_number</customer_id>\n\t<account_id>$acc_number</account_id>\n\t"
. "<version_id>{$this->ipsclass->acpversion}</version_id>\n\t<version_string>{$this->ipsclass->version}</version_string>\n\t<release_hash><![CDATA[<{%dyn.down.var.md5%}]]>></release_hash>"
. "\n</ipscheck>";
@@ -1129,12 +1144,12 @@ class display {
{
$latest_version = $this->ipsclass->DB->build_and_exec_query( array( 'select' => '*', 'from' => 'upgrade_history', 'order' => 'upgrade_version_id DESC', 'limit' => array(0, 1) ) );
if ( $this->ipsclass->version == 'v<{%dyn.down.var.human.version%}>' )
if ( $this->ipsclass->version == 'v2.2.2' )
{
$this->ipsclass->version = 'v'.$latest_version['upgrade_version_human'];
}
if ( $this->ipsclass->acpversion == '<{%dyn.down.var.long_version_id%}>' )
if ( $this->ipsclass->acpversion == '22011' )
{
$this->ipsclass->acpversion = $latest_version['upgrade_version_id'];
}
@@ -1146,7 +1161,7 @@ class display {
else
{
@header( "Content-type: text/plain" );
print "<result>0</result>\nYou do not have permission to view this page.";
print "<result>0</result>\nÂû íå èìååòå äîñòóïà ê ýòîé ñòðàíèöå.";
exit();
}
}
File diff suppressed because it is too large. Load diff
+73 -58
View File
@@ -1,17 +1,27 @@
<?php
/*
+--------------------------------------------------------------------------
| 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-26 17:13:44 +0100 (Tue, 26 Sep 2006) $
| > $Revision: 575 $
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
+---------------------------------------------------------------------------
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $Date: 2006-12-04 10:31:02 -0600 (Mon, 04 Dec 2006) $
| > $Revision: 757 $
| > $Author: matt $
+---------------------------------------------------------------------------
|
@@ -26,7 +36,7 @@
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.";
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
exit();
}
@@ -590,17 +600,19 @@ class forum_functions
{
foreach( $this->forum_cache[ $root_id ] as $data )
{
if ($data['last_post'] > $forum_data['last_post'])
if ( $data['last_post'] > $forum_data['last_post'] )
{
$forum_data['last_post'] = $data['last_post'];
$forum_data['fid'] = $data['id'];
$forum_data['last_id'] = $data['last_id'];
$forum_data['last_title'] = $data['last_title'];
$forum_data['password'] = isset($data['password']) ? $data['password'] : '';
$forum_data['last_post'] = $data['last_post'];
$forum_data['fid'] = $data['id'];
$forum_data['last_id'] = $data['last_id'];
$forum_data['last_title'] = $data['last_title'];
$forum_data['password'] = isset($data['password']) ? $data['password'] : '';
$forum_data['password_override'] = isset($data['password_override']) ? $data['password_override'] : '';
$forum_data['last_poster_id'] = $data['last_poster_id'];
$forum_data['last_poster_name'] = $data['last_poster_name'];
$forum_data['status'] = $data['status'];
$forum_data['last_poster_id'] = $data['last_poster_id'];
$forum_data['last_poster_name'] = $data['last_poster_name'];
# Bug http://forums.invisionpower.com/index.php?autocom=bugtracker&code=show_bug&bug_title_id=3931&bug_cat_id=3
#$forum_data['status'] = $data['status'];
//-----------------------------------------
// Is this forum last post > current last post
@@ -710,55 +722,58 @@ class forum_functions
{
$jump_string = "";
foreach( $this->forum_cache['root'] as $forum_data )
if( is_array($this->forum_cache['root']) AND count($this->forum_cache['root']) )
{
if ( $forum_data['sub_can_post'] or ( isset($this->forum_cache[ $forum_data['id'] ]) AND is_array($this->forum_cache[ $forum_data['id'] ]) AND count($this->forum_cache[ $forum_data['id'] ]) ) )
foreach( $this->forum_cache['root'] as $forum_data )
{
$forum_data['redirect_on'] = isset($forum_data['redirect_on']) ? $forum_data['redirect_on'] : 0;
if( $remove_redirects == 1 AND $forum_data['redirect_on'] == 1 )
if ( $forum_data['sub_can_post'] or ( isset($this->forum_cache[ $forum_data['id'] ]) AND is_array($this->forum_cache[ $forum_data['id'] ]) AND count($this->forum_cache[ $forum_data['id'] ]) ) )
{
continue;
}
$selected = "";
if ($html == 1 or $override == 1)
{
if ($this->ipsclass->input['f'] and $this->ipsclass->input['f'] == $forum_data['id'])
$forum_data['redirect_on'] = isset($forum_data['redirect_on']) ? $forum_data['redirect_on'] : 0;
if( $remove_redirects == 1 AND $forum_data['redirect_on'] == 1 )
{
$selected = ' selected="selected"';
continue;
}
}
$jump_string .= "<option value=\"{$forum_data['id']}\"".$selected.">".$forum_data['name']."</option>\n";
$depth_guide = $this->depth_guide;
if ( array_key_exists( $forum_data['id'], $this->forum_cache ) AND is_array( $this->forum_cache[ $forum_data['id'] ] ) )
{
foreach( $this->forum_cache[ $forum_data['id'] ] as $forum_data )
$selected = "";
if ($html == 1 or $override == 1)
{
if( $remove_redirects == 1 AND $forum_data['redirect_on'] == 1 )
if ($this->ipsclass->input['f'] and $this->ipsclass->input['f'] == $forum_data['id'])
{
continue;
}
if ($html == 1 or $override == 1)
{
$selected = "";
if ($this->ipsclass->input['f'] and $this->ipsclass->input['f'] == $forum_data['id'])
{
$selected = ' selected="selected"';
}
$selected = ' selected="selected"';
}
$jump_string .= "<option value=\"{$forum_data['id']}\"".$selected.">&nbsp;&nbsp;&#0124;".$depth_guide." ".$forum_data['name']."</option>\n";
if( $this->ipsclass->vars['short_forum_jump'] == 0 OR $override == 1 )
}
$jump_string .= "<option value=\"{$forum_data['id']}\"".$selected.">".$forum_data['name']."</option>\n";
$depth_guide = $this->depth_guide;
if ( array_key_exists( $forum_data['id'], $this->forum_cache ) AND is_array( $this->forum_cache[ $forum_data['id'] ] ) )
{
foreach( $this->forum_cache[ $forum_data['id'] ] as $forum_data )
{
$jump_string = $this->forums_forum_jump_internal( $forum_data['id'], $jump_string, $depth_guide . $this->depth_guide, $html, $override, $remove_redirects );
if( $remove_redirects == 1 AND $forum_data['redirect_on'] == 1 )
{
continue;
}
if ($html == 1 or $override == 1)
{
$selected = "";
if ($this->ipsclass->input['f'] and $this->ipsclass->input['f'] == $forum_data['id'])
{
$selected = ' selected="selected"';
}
}
$jump_string .= "<option value=\"{$forum_data['id']}\"".$selected.">&nbsp;&nbsp;&#0124;".$depth_guide." ".$forum_data['name']."</option>\n";
if( $this->ipsclass->vars['short_forum_jump'] == 0 OR $override == 1 )
{
$jump_string = $this->forums_forum_jump_internal( $forum_data['id'], $jump_string, $depth_guide . $this->depth_guide, $html, $override, $remove_redirects );
}
}
}
}
@@ -904,6 +919,11 @@ class forum_functions
function forums_new_posts($forum_data)
{
if ( ! $forum_data['status'] )
{
return "<{C_LOCKED}>";
}
$sub = 0;
if ( isset($forum_data['subforums']) AND count($forum_data['subforums']) )
@@ -941,11 +961,6 @@ class forum_functions
if ($sub == 0)
{
if ( ! $forum_data['status'] )
{
return "<{C_LOCKED}>";
}
$sub_cat_img = '';
}
else
+65 -24
View File
@@ -1,18 +1,28 @@
<?php
/*
+--------------------------------------------------------------------------
| 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-11 13:55:47 +0100 (Wed, 11 Oct 2006) $
| > $Revision: 624 $
| > $Author: matt $
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
+---------------------------------------------------------------------------
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $Date: 2006-11-13 17:05:48 -0600 (Mon, 13 Nov 2006) $
| > $Revision: 728 $
| > $Author: bfarber $
+---------------------------------------------------------------------------
|
| > SESSION CLASS
@@ -26,7 +36,7 @@
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.";
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
exit();
}
@@ -119,7 +129,7 @@ class session
{
foreach ($this->ipsclass->cache['banfilters'] as $ip)
{
$ip = str_replace( '\*', '.*', preg_quote($ip, "/") );
$ip = str_replace( '\*', '.*', preg_quote( trim($ip), "/") );
if ( preg_match( "/^$ip$/", $this->ipsclass->input['IP_ADDRESS'] ) )
{
@@ -157,7 +167,8 @@ class session
if ( ($this->ipsclass->input['act'] == 'chat' and $this->ipsclass->input['CODE'] == 'update')
OR $this->ipsclass->input['act'] == 'xmlout'
OR $this->ipsclass->input['act'] == 'rssout' )
OR $this->ipsclass->input['act'] == 'rssout'
OR $this->ipsclass->input['act'] == 'attach' )
{
$this->ipsclass->no_print_header = 1;
$this->do_update = 0;
@@ -216,7 +227,7 @@ class session
$this->session_id = "";
$agent = trim($match[0]);
$agent = str_replace( '\r', '', $agent );
$agent = substr( str_replace( '\r', '', $agent ), 0, 40 );
//-----------------------------------------
// Using lofi?
@@ -248,7 +259,7 @@ class session
$this->ipsclass->DB->simple_construct( array( 'delete' => 'sessions',
'where' => "id='".$agent.'='.str_replace('.','',$this->ipsclass->ip_address )."_session'"
) );
$this->ipsclass->DB->simple_shutdown_exec();
$this->ipsclass->DB->simple_exec();
$this->create_bot_session($agent, $this->bot_map[ strtolower($agent) ]);
}
@@ -327,8 +338,21 @@ class session
if ( $cookie['member_id'] != "" and $cookie['pass_hash'] != "" )
{
//-----------------------------------------
// Load member
//-----------------------------------------
$this->load_member( $cookie['member_id'] );
//-----------------------------------------
// INIT log in key stuff
//-----------------------------------------
$_ok = 1;
$_days = 0;
$_sticky = 1;
$_time = ( $this->ipsclass->vars['login_key_expire'] ) ? ( time() + ( intval($this->ipsclass->vars['login_key_expire']) * 86400 ) ) : 0;
if ( (! $this->member['id']) or ($this->member['id'] == 0) )
{
$this->unload_member();
@@ -343,17 +367,22 @@ class session
//-----------------------------------------
if ( $this->ipsclass->stronghold_check_cookie( $this->member['id'], $this->member['member_login_key'] ) !== TRUE )
{
{
//-----------------------------------------
// Create new log in key as stronghold
// failed
//-----------------------------------------
$this->member['member_login_key'] = $this->ipsclass->converge->generate_auto_log_in_key();
$this->ipsclass->DB->do_update( 'members', array( 'member_login_key' => $this->member['member_login_key'],
'member_login_key_expire' => $_time ), 'id='.$this->member['id'] );
$this->unload_member();
$this->create_guest_session();
}
else
{
$_ok = 1;
$_days = 0;
$_sticky = 1;
$_time = ( $this->ipsclass->vars['login_key_expire'] ) ? ( time() + ( intval($this->ipsclass->vars['login_key_expire']) * 86400 ) ) : 0;
//-----------------------------------------
// Key expired?
//-----------------------------------------
@@ -492,11 +521,11 @@ class session
{
$this->member['is_mod'] = 1;
}
else if ( count($this->ipsclass->cache['moderators']) )
else if ( is_array($this->ipsclass->cache['moderators']) AND count($this->ipsclass->cache['moderators']) )
{
$other_mgroups = array();
if( $this->member['mgroup_others'] )
if ( $this->member['mgroup_others'] )
{
$other_mgroups = explode( ",", $this->ipsclass->clean_perm_string( $this->member['mgroup_others'] ) );
}
@@ -628,7 +657,7 @@ class session
$groups_id = explode( ',', $this->member['mgroup_others'] );
$exclude = array( 'g_title', 'g_icon', 'prefix', 'suffix', 'g_promotion', 'g_photo_max_vars' );
$less_is_more = array( 'g_search_flood' );
$zero_is_best = array( 'g_attach_max', 'g_edit_cutoff' );
$zero_is_best = array( 'g_attach_max', 'g_attach_per_post', 'g_edit_cutoff', 'g_max_messages' );
if ( count( $groups_id ) )
{
@@ -661,6 +690,10 @@ class session
{
continue;
}
else if( $v == 0 )
{
$this->member[ $k ] = 0;
}
else if ( $v > $this->member[ $k ] )
{
$this->member[ $k ] = $v;
@@ -827,6 +860,8 @@ class session
return;
}
$this->ipsclass->my_setcookie( "pass_hash", $this->member['member_login_key'], 0, $this->ipsclass->vars['login_key_expire'] );
$this->ipsclass->DB->force_data_type = array( 'member_name' => 'string' );
$this->ipsclass->DB->do_shutdown_update( 'sessions',
@@ -834,7 +869,7 @@ class session
'member_name' => $this->member['members_display_name'],
'member_id' => intval($this->member['id']),
'member_group' => $this->member['mgroup'],
'login_type' => substr($this->member['login_anonymous'],0, 1),
'login_type' => intval(substr($this->member['login_anonymous'],0, 1)),
'running_time' => $this->time_now,
'location' => $vars['location'],
'in_error' => 0,
@@ -847,6 +882,8 @@ class session
),
"id='{$this->session_id}'"
);
$this->ipsclass->DB->do_shutdown_update( 'members', array( 'member_login_key_expire' => time() + ( $this->ipsclass->vars['login_key_expire'] * 86400 ) ), "id={$this->member['id']}" );
}
/*-------------------------------------------------------------------------*/
@@ -887,7 +924,7 @@ class session
'member_name' => '',
'member_id' => 0,
'member_group' => $this->ipsclass->vars['guest_group'],
'login_type' => '',
'login_type' => 0,
'running_time' => $this->time_now,
'location' => $vars['location'],
'in_error' => 0,
@@ -1019,7 +1056,7 @@ class session
'member_name' => $this->member['members_display_name'],
'member_id' => intval($this->member['id']),
'member_group' => $this->member['mgroup'],
'login_type' => substr($this->member['login_anonymous'],0, 1),
'login_type' => intval(substr($this->member['login_anonymous'],0, 1)),
'running_time' => $this->time_now,
'ip_address' => $this->ipsclass->ip_address,
'browser' => $this->ipsclass->user_agent,
@@ -1062,6 +1099,10 @@ class session
$this->ipsclass->input['last_visit'] = $this->member['last_activity'];
$this->ipsclass->input['last_activity'] = $this->time_now;
}
$this->ipsclass->my_setcookie( "pass_hash", $this->member['member_login_key'], 0, $this->ipsclass->vars['login_key_expire'] );
$this->ipsclass->DB->do_shutdown_update( 'members', array( 'member_login_key_expire' => time() + ( $this->ipsclass->vars['login_key_expire'] * 86400 ) ), "id={$this->member['id']}" );
}
else
{
@@ -1164,13 +1205,13 @@ class session
$this->ipsclass->DB->force_data_type = array( 'member_name' => 'string' );
$this->ipsclass->DB->do_shutdown_insert( 'sessions',
$this->ipsclass->DB->do_insert( 'sessions',
array(
'id' => $bot.'='.str_replace('.','',$this->ipsclass->ip_address ).'_session',
'member_name' => $name ? $name : $bot,
'member_id' => 0,
'member_group' => $this->ipsclass->vars['spider_group'],
'login_type' => $this->ipsclass->vars['spider_anon'],
'login_type' => intval($this->ipsclass->vars['spider_anon']),
'running_time' => $this->time_now,
'ip_address' => $this->ipsclass->ip_address,
'browser' => $this->ipsclass->user_agent,
@@ -1205,7 +1246,7 @@ class session
'member_name' => $name ? $name : $bot,
'member_id' => 0,
'member_group' => $this->ipsclass->vars['spider_group'],
'login_type' => $this->ipsclass->vars['spider_anon'],
'login_type' => intval($this->ipsclass->vars['spider_anon']),
'running_time' => $this->time_now,
'location' => $vars['location'],
'in_error' => 0,
+486 -466
View File
@@ -1,467 +1,487 @@
<?php
/*
+--------------------------------------------------------------------------
| Invision Power Board
| =============================================
| by Matthew Mecham
| (c) 2001 - 2006 Invision Power Services, Inc.
| http://www.invisionpower.com
| =============================================
| Web: http://www.invisionboard.com
| Licence Info: http://www.invisionboard.com/?license
+---------------------------------------------------------------------------
| > $Date: 2006-06-23 10:44:15 +0100 (Fri, 23 Jun 2006) $
| > $Revision: 338 $
| > $Author: matt $
+---------------------------------------------------------------------------
|
| > Virus Checker CLASS
| > Module written by Brandon Farber / Matt Mecham
| > Date started: Monday 3rd July 2006
|
| > Module Version Number: 1.0.0
| > DBA Checked: Wed 19 May 2004
+--------------------------------------------------------------------------
*/
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();
}
class class_virus_checker
{
/**
* Global
*/
var $ipsclass;
/**
* Directory separator
*/
var $dir_split = "/";
/**
* Dodgy files
* @var array [ idx ] = ( file_path, file_name );
*/
var $bad_files = array();
/**
* Checked folders
*/
var $checked_folders = array();
/**
* Known names
*/
var $known_names = array();
/*-------------------------------------------------------------------------*/
// CONSTRUCTAA
/*-------------------------------------------------------------------------*/
function class_virus_checker()
{
set_time_limit(0);
if ( strtoupper( substr(PHP_OS, 0, 3) ) === 'WIN' )
{
$this->dir_split = "\\";
}
//-----------------------------------------
// Known names
//-----------------------------------------
require( ROOT_PATH . 'sources/classes/class_virus_checker/lib_known_names.php' );
$this->known_names = $KNOWN_NAMES;
}
/*-------------------------------------------------------------------------*/
// Run the scan
/*-------------------------------------------------------------------------*/
/**
* Runs the scan
* All suspicious files are entered into
* $this->bad_files array
*/
function run_scan()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$expected = array();
$root_dir = preg_replace( "#^(.+?)\/$#", "\\1", ROOT_PATH );
$skin_dirs = array();
//-----------------------------------------
// Load extra db cache file
//-----------------------------------------
$this->ipsclass->DB->load_cache_file( ROOT_PATH.'sources/sql/'.SQL_DRIVER.'_extra_queries.php', 'sql_extra_queries' );
//-----------------------------------------
// Get libs
//-----------------------------------------
require( ROOT_PATH . 'sources/classes/class_virus_checker/lib_writeable_dirs.php' );
require( ROOT_PATH . 'sources/classes/class_virus_checker/lib_lang_files.php' );
//-----------------------------------------
// Sort out directory separator
//-----------------------------------------
if ( $this->dir_split != '/' )
{
$_WRITEABLE_DIRS = $WRITEABLE_DIRS;
$WRITEABLE_DIRS = array();
foreach( $_WRITEABLE_DIRS as $dir )
{
$WRITEABLE_DIRS[] = str_replace( '/' , $this->dir_split, $dir );
}
}
//-----------------------------------------
// Get language directories
//-----------------------------------------
if ( isset($this->ipsclass->cache['languages']) AND is_array( $this->ipsclass->cache['languages'] ) && count( $this->ipsclass->cache['languages'] ) )
{
foreach( $this->ipsclass->cache['languages'] as $v )
{
$WRITEABLE_DIRS[] = 'cache'.$this->dir_split.'lang_cache'.$this->dir_split.$v['ldir'];
foreach( $LANG_FILES as $filename )
{
$expected[] = 'cache'.$this->dir_split.'lang_cache'.$this->dir_split.$v['ldir'].$this->dir_split.$filename.'.php';
}
}
}
else
{
$this->ipsclass->DB->build_query( array( 'select' => 'ldir', 'from' => 'languages' ) );
$this->ipsclass->DB->exec_query();
while( $v = $this->ipsclass->DB->fetch_row() )
{
$WRITEABLE_DIRS[] = 'cache'.$this->dir_split.'lang_cache'.$this->dir_split.$v['ldir'];
foreach( $LANG_FILES as $filename )
{
$expected[] = 'cache'.$this->dir_split.'lang_cache'.$this->dir_split.$v['ldir'].$this->dir_split.$filename.'.php';
}
}
}
//-----------------------------------------
// Get skin directories
//-----------------------------------------
if ( is_array( $this->ipsclass->cache['skin_id_cache'] ) && count( $this->ipsclass->cache['skin_id_cache'] ) )
{
foreach( $this->ipsclass->cache['skin_id_cache'] as $k => $v )
{
if ( $k == 1 && !IN_DEV )
{
continue;
}
$WRITEABLE_DIRS[] = 'cache'.$this->dir_split.'skin_cache'.$this->dir_split.'cacheid_'.$v['set_skin_set_id'];
$skin_dirs[] = $v['set_skin_set_id'];
}
}
else
{
$this->ipsclass->DB->build_query( array( 'select' => 'set_skin_set_id', 'from' => 'skin_sets' ) );
$this->ipsclass->DB->exec_query();
while( $v = $this->ipsclass->DB->fetch_row() )
{
$WRITEABLE_DIRS[] = 'cache'.$this->dir_split.'skin_cache'.$this->dir_split.'cacheid_'.$v['set_skin_set_id '];
$skin_dirs[] = $v['set_skin_set_id'];
}
}
//-----------------------------------------
// Get skin files
//-----------------------------------------
$this->ipsclass->DB->cache_add_query( 'diag_distinct_skins', array(), 'sql_extra_queries' );
$this->ipsclass->DB->cache_exec_query();
while( $v = $this->ipsclass->DB->fetch_row() )
{
foreach( $skin_dirs as $dir )
{
$expected[] = 'cache'.$this->dir_split.'skin_cache'.$this->dir_split.'cacheid_'.$dir.$this->dir_split.$v['group_name'].'.php';
}
}
//-----------------------------------------
// Alright, do it!
//-----------------------------------------
$WRITEABLE_DIRS = array_unique($WRITEABLE_DIRS);
foreach( $WRITEABLE_DIRS as $dir_to_check )
{
if ( $dir_to_check == 'uploads' OR $dir_to_check == 'style_emoticons' )
{
# Leave this 'til later
continue;
}
if ( file_exists( $root_dir . $this->dir_split . $dir_to_check ) )
{
$this->checked_folders[] = $root_dir . $this->dir_split . $dir_to_check;
$dh = opendir( $root_dir . $this->dir_split . $dir_to_check );
while ( false !== ( $file = readdir($dh) ) )
{
if ( preg_match( "#.*\.(php|js|html|htm|cgi|pl|perl|php3|php4|php5|php6)$#i", $file ) )
{
if ( ! in_array( $dir_to_check.$this->dir_split.$file, $expected ) AND $file != "index.html" AND $file != 'lang_javascript.js' )
{
$score = intval( $this->score_file( $root_dir.$this->dir_split.$dir_to_check.$this->dir_split.$file ) );
$this->bad_files[] = array( 'file_path' => $root_dir.$this->dir_split.$dir_to_check.$this->dir_split.$file,
'file_name' => $file,
'score' => $score );
}
}
}
@closedir($dh);
}
}
//-----------------------------------------
// Check 'blog' dir
//-----------------------------------------
if ( file_exists( $root_dir.$this->dir_split.'blog' ) )
{
$this->anti_virus_deep_scan( $root_dir.$this->dir_split.'blog', 'all', array( 'index.php' ) );
}
//-----------------------------------------
// Check 'html' dir
//-----------------------------------------
if ( file_exists( $root_dir.$this->dir_split.'html' ) )
{
$this->anti_virus_deep_scan( $root_dir.$this->dir_split.'html', 'all', array( 'index.php' ) );
}
//-----------------------------------------
// Check 'Skin' dir
//-----------------------------------------
if ( file_exists( $root_dir.$this->dir_split.'Skin' ) )
{
$this->anti_virus_deep_scan( $root_dir.$this->dir_split.'Skin', 'all' );
}
//-----------------------------------------
// Check emoticons
//-----------------------------------------
$this->anti_virus_deep_scan( $root_dir.$this->dir_split.'style_emoticons', 'all' );
//-----------------------------------------
// Check image directories
//-----------------------------------------
$this->anti_virus_deep_scan( $root_dir.$this->dir_split.'style_images', '(php|cgi|pl|perl|php3|php4|php5|php6|phtml|shtml)' );
//-----------------------------------------
// Check upload directories
//-----------------------------------------
$this->anti_virus_deep_scan( $root_dir.$this->dir_split.'uploads' );
}
/*-------------------------------------------------------------------------*/
// Score a file
/*-------------------------------------------------------------------------*/
/**
* Score a file
*
* Return a score from 0 being harmless to 10 being, well the complete opposite to harmless.
*
* Score information:
* Name 3 chars or less + 2
* '- Name 2 chars or less + 4
* Size over 65k + 3
* '- Size over 100k + 4
* User nobody + 3
* Modified in the 30 days + 1
* In non PHP folder + 3
*
* @param string Full file path and name
* @param array stat info
*
* @return int Score (0 - 10 )
*/
function score_file( $file_name, $stat=array() )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$SCORE = 0;
$name = preg_replace( "#^(.*)/(.+?)$#is" , "\\2", $file_name );
$name_sans_ext = preg_replace( "#^(.*)\.(.+?)$#si", "\\1", $name );
//-----------------------------------------
// Check
//-----------------------------------------
if ( ! $file_name )
{
return -1;
}
if ( ! is_array( $stat ) OR ! count( $stat ) )
{
$stat = stat( $file_name );
}
//-----------------------------------------
// Alright...
//-----------------------------------------
if ( in_array( $file_name, $this->known_names ) )
{
$SCORE += 7;
}
//-----------------------------------------
// User nobody?
//-----------------------------------------
if ( $stat['uid'] == 99 )
{
$SCORE += 3;
}
if ( strlen( $name_sans_ext ) < 3 )
{
$SCORE += 4;
}
else if ( $name_sans_ext == 'temp' OR $name_sans_ext == 'test' )
{
$SCORE +=2;
}
else if ( strlen( $name_sans_ext ) < 4 )
{
$SCORE += 2;
}
//-----------------------------------------
// Size
//-----------------------------------------
if ( $stat['size'] > 100 * 1024 )
{
$SCORE += 4;
}
else if ( $stat['size'] > 65 * 1024 )
{
$SCORE += 3;
}
//-----------------------------------------
// Last modified...
//-----------------------------------------
if ( $stat['mtime'] > time() - 86400 * 30 )
{
$SCORE += 1;
}
//-----------------------------------------
// Non PHP folder...
//-----------------------------------------
if ( preg_match( "#(?:style_images|style_emoticons|uploads|style_avatars|default|1|skin_acp|html|skin)/#i", $file_name ) )
{
$SCORE += 3;
}
//-----------------------------------------
// Return
//-----------------------------------------
return $SCORE > 10 ? 10 : $SCORE;
}
/*-------------------------------------------------------------------------*/
// Deep scan
/*-------------------------------------------------------------------------*/
/**
* Deep scan
*
* All suspicious files are entered into
* $this->bad_files array
*/
function anti_virus_deep_scan( $dir, $look_for='(php|js|html|htm|cgi|pl|perl|php3|php4|php5|php6|htaccess|so|phtml|shtml)', $ignore_files=array() )
{
//-----------------------------------------
// Short-hand
//-----------------------------------------
if ( $look_for == 'all' )
{
$look_for = '(php|js|html|htm|cgi|pl|perl|php3|php4|php5|php6|htaccess|so|phtml|shtml)';
}
//-----------------------------------------
// Add into checked folders
//-----------------------------------------
$this->checked_folders[] = $dir . $this->dir_split . $file;
$dh = opendir( $dir );
while ( false !== ( $file = readdir($dh) ) )
{
if ( $file == '.' or $file == '..' or $file == '.svn' or $file == '.DS_store' or $file == 'index.html' )
{
continue;
}
if ( is_dir( $dir . $this->dir_split . $file ) )
{
$this->anti_virus_deep_scan( $dir . $this->dir_split . $file, $look_for );
}
else
{
if ( in_array( $dir . $this->dir_split . $file, $ignore_files ) )
{
continue;
}
if ( preg_match( "#^(.*)?\.".$look_for."$#i", $file ) )
{
$score = intval( $this->score_file( $dir . $this->dir_split . $file ) );
$this->bad_files[] = array( 'file_path' => $dir . $this->dir_split . $file,
'file_name' => $file,
'score' => $score );
}
}
}
}
}
<?php
/*
+--------------------------------------------------------------------------
| 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
+---------------------------------------------------------------------------
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
+---------------------------------------------------------------------------
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $Date: 2006-06-23 10:44:15 +0100 (Fri, 23 Jun 2006) $
| > $Revision: 338 $
| > $Author: matt $
+---------------------------------------------------------------------------
|
| > Virus Checker CLASS
| > Module written by Brandon Farber / Matt Mecham
| > Date started: Monday 3rd July 2006
|
| > Module Version Number: 1.0.0
| > DBA Checked: Wed 19 May 2004
+--------------------------------------------------------------------------
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
exit();
}
class class_virus_checker
{
/**
* Global
*/
var $ipsclass;
/**
* Directory separator
*/
var $dir_split = "/";
/**
* Dodgy files
* @var array [ idx ] = ( file_path, file_name );
*/
var $bad_files = array();
/**
* Checked folders
*/
var $checked_folders = array();
/**
* Known names
*/
var $known_names = array();
/*-------------------------------------------------------------------------*/
// CONSTRUCTAA
/*-------------------------------------------------------------------------*/
function class_virus_checker()
{
set_time_limit(0);
if ( strtoupper( substr(PHP_OS, 0, 3) ) === 'WIN' )
{
$this->dir_split = "\\";
}
//-----------------------------------------
// Known names
//-----------------------------------------
require( ROOT_PATH . 'sources/classes/class_virus_checker/lib_known_names.php' );
$this->known_names = $KNOWN_NAMES;
}
/*-------------------------------------------------------------------------*/
// Run the scan
/*-------------------------------------------------------------------------*/
/**
* Runs the scan
* All suspicious files are entered into
* $this->bad_files array
*/
function run_scan()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$expected = array();
$root_dir = preg_replace( "#^(.+?)\/$#", "\\1", ROOT_PATH );
$skin_dirs = array();
//-----------------------------------------
// Load extra db cache file
//-----------------------------------------
$this->ipsclass->DB->load_cache_file( ROOT_PATH.'sources/sql/'.SQL_DRIVER.'_extra_queries.php', 'sql_extra_queries' );
//-----------------------------------------
// Get libs
//-----------------------------------------
require( ROOT_PATH . 'sources/classes/class_virus_checker/lib_writeable_dirs.php' );
require( ROOT_PATH . 'sources/classes/class_virus_checker/lib_lang_files.php' );
//-----------------------------------------
// Sort out directory separator
//-----------------------------------------
if ( $this->dir_split != '/' )
{
$_WRITEABLE_DIRS = $WRITEABLE_DIRS;
$WRITEABLE_DIRS = array();
foreach( $_WRITEABLE_DIRS as $dir )
{
$WRITEABLE_DIRS[] = str_replace( '/' , $this->dir_split, $dir );
}
}
//-----------------------------------------
// Get language directories
//-----------------------------------------
if ( isset($this->ipsclass->cache['languages']) AND is_array( $this->ipsclass->cache['languages'] ) && count( $this->ipsclass->cache['languages'] ) )
{
foreach( $this->ipsclass->cache['languages'] as $v )
{
$WRITEABLE_DIRS[] = 'cache'.$this->dir_split.'lang_cache'.$this->dir_split.$v['ldir'];
foreach( $LANG_FILES as $filename )
{
$expected[] = 'cache'.$this->dir_split.'lang_cache'.$this->dir_split.$v['ldir'].$this->dir_split.$filename.'.php';
}
}
}
else
{
$this->ipsclass->DB->build_query( array( 'select' => 'ldir', 'from' => 'languages' ) );
$this->ipsclass->DB->exec_query();
while( $v = $this->ipsclass->DB->fetch_row() )
{
$WRITEABLE_DIRS[] = 'cache'.$this->dir_split.'lang_cache'.$this->dir_split.$v['ldir'];
foreach( $LANG_FILES as $filename )
{
$expected[] = 'cache'.$this->dir_split.'lang_cache'.$this->dir_split.$v['ldir'].$this->dir_split.$filename.'.php';
}
}
}
//-----------------------------------------
// Get skin directories
//-----------------------------------------
if ( is_array( $this->ipsclass->cache['skin_id_cache'] ) && count( $this->ipsclass->cache['skin_id_cache'] ) )
{
foreach( $this->ipsclass->cache['skin_id_cache'] as $k => $v )
{
if ( $k == 1 && !IN_DEV )
{
continue;
}
$WRITEABLE_DIRS[] = 'cache'.$this->dir_split.'skin_cache'.$this->dir_split.'cacheid_'.$v['set_skin_set_id'];
$skin_dirs[] = $v['set_skin_set_id'];
}
}
else
{
$this->ipsclass->DB->build_query( array( 'select' => 'set_skin_set_id', 'from' => 'skin_sets' ) );
$this->ipsclass->DB->exec_query();
while( $v = $this->ipsclass->DB->fetch_row() )
{
$WRITEABLE_DIRS[] = 'cache'.$this->dir_split.'skin_cache'.$this->dir_split.'cacheid_'.$v['set_skin_set_id '];
$skin_dirs[] = $v['set_skin_set_id'];
}
}
//-----------------------------------------
// Get skin files
//-----------------------------------------
$this->ipsclass->DB->cache_add_query( 'diag_distinct_skins', array(), 'sql_extra_queries' );
$this->ipsclass->DB->cache_exec_query();
while( $v = $this->ipsclass->DB->fetch_row() )
{
foreach( $skin_dirs as $dir )
{
$expected[] = 'cache'.$this->dir_split.'skin_cache'.$this->dir_split.'cacheid_'.$dir.$this->dir_split.$v['group_name'].'.php';
}
}
//-----------------------------------------
// Alright, do it!
//-----------------------------------------
$WRITEABLE_DIRS = array_unique($WRITEABLE_DIRS);
foreach( $WRITEABLE_DIRS as $dir_to_check )
{
if ( $dir_to_check == 'uploads' OR $dir_to_check == 'style_emoticons' )
{
# Leave this 'til later
continue;
}
if ( file_exists( $root_dir . $this->dir_split . $dir_to_check ) )
{
$this->checked_folders[] = $root_dir . $this->dir_split . $dir_to_check;
$dh = opendir( $root_dir . $this->dir_split . $dir_to_check );
while ( false !== ( $file = readdir($dh) ) )
{
if ( preg_match( "#.*\.(php|js|html|htm|cgi|pl|perl|php3|php4|php5|php6)$#i", $file ) )
{
if ( ! in_array( $dir_to_check.$this->dir_split.$file, $expected ) AND $file != "index.html" AND $file != 'lang_javascript.js' )
{
$score = intval( $this->score_file( $root_dir.$this->dir_split.$dir_to_check.$this->dir_split.$file ) );
$this->bad_files[] = array( 'file_path' => $root_dir.$this->dir_split.$dir_to_check.$this->dir_split.$file,
'file_name' => $file,
'score' => $score );
}
}
}
@closedir($dh);
}
}
//-----------------------------------------
// Check 'blog' dir
//-----------------------------------------
if ( file_exists( $root_dir.$this->dir_split.'blog' ) )
{
$this->anti_virus_deep_scan( $root_dir.$this->dir_split.'blog', 'all', array( 'index.php' ) );
}
//-----------------------------------------
// Check 'html' dir
//-----------------------------------------
if ( file_exists( $root_dir.$this->dir_split.'html' ) )
{
$this->anti_virus_deep_scan( $root_dir.$this->dir_split.'html', 'all', array( 'index.php' ) );
}
//-----------------------------------------
// Check 'Skin' dir
//-----------------------------------------
if ( file_exists( $root_dir.$this->dir_split.'Skin' ) )
{
$this->anti_virus_deep_scan( $root_dir.$this->dir_split.'Skin', 'all' );
}
//-----------------------------------------
// Check emoticons
//-----------------------------------------
$this->anti_virus_deep_scan( $root_dir.$this->dir_split.'style_emoticons', 'all' );
//-----------------------------------------
// Check image directories
//-----------------------------------------
$this->anti_virus_deep_scan( $root_dir.$this->dir_split.'style_images', '(php|cgi|pl|perl|php3|php4|php5|php6|phtml|shtml)' );
//-----------------------------------------
// Check upload directories
//-----------------------------------------
$this->anti_virus_deep_scan( $root_dir.$this->dir_split.'uploads' );
}
/*-------------------------------------------------------------------------*/
// Score a file
/*-------------------------------------------------------------------------*/
/**
* Score a file
*
* Return a score from 0 being harmless to 10 being, well the complete opposite to harmless.
*
* Score information:
* Name 3 chars or less + 2
* '- Name 2 chars or less + 4
* Size over 65k + 3
* '- Size over 100k + 4
* User nobody + 3
* Modified in the 30 days + 1
* In non PHP folder + 3
*
* @param string Full file path and name
* @param array stat info
*
* @return int Score (0 - 10 )
*/
function score_file( $file_name, $stat=array() )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$SCORE = 0;
$name = preg_replace( "#^(.*)/(.+?)$#is" , "\\2", $file_name );
$name_sans_ext = preg_replace( "#^(.*)\.(.+?)$#si", "\\1", $name );
//-----------------------------------------
// Check
//-----------------------------------------
if ( ! $file_name )
{
return -1;
}
if ( ! is_array( $stat ) OR ! count( $stat ) )
{
$stat = stat( $file_name );
}
//-----------------------------------------
// Alright...
//-----------------------------------------
if ( in_array( $file_name, $this->known_names ) )
{
$SCORE += 7;
}
//-----------------------------------------
// User nobody?
//-----------------------------------------
if ( $stat['uid'] == 99 )
{
$SCORE += 3;
}
if ( strlen( $name_sans_ext ) < 3 )
{
$SCORE += 4;
}
else if ( $name_sans_ext == 'temp' OR $name_sans_ext == 'test' )
{
$SCORE +=2;
}
else if ( strlen( $name_sans_ext ) < 4 )
{
$SCORE += 2;
}
//-----------------------------------------
// Size
//-----------------------------------------
if ( $stat['size'] > 100 * 1024 )
{
$SCORE += 4;
}
else if ( $stat['size'] > 65 * 1024 )
{
$SCORE += 3;
}
//-----------------------------------------
// Last modified...
//-----------------------------------------
if ( $stat['mtime'] > time() - 86400 * 30 )
{
$SCORE += 1;
}
//-----------------------------------------
// Non PHP folder...
//-----------------------------------------
if ( preg_match( "#(?:style_images|style_emoticons|uploads|style_avatars|default|1|skin_acp|html|skin)/#i", $file_name ) )
{
$SCORE += 3;
}
//-----------------------------------------
// Return
//-----------------------------------------
return $SCORE > 10 ? 10 : $SCORE;
}
/*-------------------------------------------------------------------------*/
// Deep scan
/*-------------------------------------------------------------------------*/
/**
* Deep scan
*
* All suspicious files are entered into
* $this->bad_files array
*/
function anti_virus_deep_scan( $dir, $look_for='(php|js|html|htm|cgi|pl|perl|php3|php4|php5|php6|htaccess|so|phtml|shtml)', $ignore_files=array() )
{
//-----------------------------------------
// Short-hand
//-----------------------------------------
if ( $look_for == 'all' )
{
$look_for = '(php|js|html|htm|cgi|pl|perl|php3|php4|php5|php6|htaccess|so|phtml|shtml)';
}
//-----------------------------------------
// Add into checked folders
//-----------------------------------------
$this->checked_folders[] = $dir . $this->dir_split . $file;
$dh = opendir( $dir );
while ( false !== ( $file = readdir($dh) ) )
{
if ( IN_DEV )
{
if ( $file == '.' or $file == '..' or $file == '.svn' or $file == '.DS_store' or $file == 'index.html' )
{
continue;
}
}
else
{
if ( $file == '.' or $file == '..' )
{
continue;
}
}
if ( is_dir( $dir . $this->dir_split . $file ) )
{
$this->anti_virus_deep_scan( $dir . $this->dir_split . $file, $look_for );
}
else
{
if ( in_array( $dir . $this->dir_split . $file, $ignore_files ) )
{
continue;
}
if ( preg_match( "#^(.*)?\.".$look_for."(?:\..+?)?$#i", $file ) )
{
$score = intval( $this->score_file( $dir . $this->dir_split . $file ) );
$this->bad_files[] = array( 'file_path' => $dir . $this->dir_split . $file,
'file_name' => $file,
'score' => $score );
}
}
}
}
}
?>
@@ -0,0 +1,10 @@
<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>
@@ -1,15 +1,24 @@
<?php
/*
+--------------------------------------------------------------------------
| Invision Power Board
| ========================================
| Invision Power Board 2.2.2
| =============================================
| by Matthew Mecham
| (c) 2001 - 2003 Invision Power Services
| http://www.invisionpower.com
| ========================================
| =============================================
| Web: http://www.invisionboard.com
| Email: matt@invisionpower.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
+---------------------------------------------------------------------------
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
+---------------------------------------------------------------------------
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+--------------------------------------------------------------------------
*/
@@ -1,15 +1,24 @@
<?php
/*
+--------------------------------------------------------------------------
| Invision Power Board
| ========================================
| Invision Power Board 2.2.2
| =============================================
| by Matthew Mecham
| (c) 2001 - 2003 Invision Power Services
| http://www.invisionpower.com
| ========================================
| =============================================
| Web: http://www.invisionboard.com
| Email: matt@invisionpower.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
+---------------------------------------------------------------------------
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
+---------------------------------------------------------------------------
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+--------------------------------------------------------------------------
*/
@@ -52,7 +61,8 @@ $LANG_FILES = array(
'lang_blog_portal',
'lang_blog_emails',
'lang_gallery',
'lang_gallery_location'
'lang_gallery_location',
'lang_downloads'
);
?>
@@ -1,15 +1,24 @@
<?php
/*
+--------------------------------------------------------------------------
| Invision Power Board
| ========================================
| Invision Power Board 2.2.2
| =============================================
| by Matthew Mecham
| (c) 2001 - 2003 Invision Power Services
| http://www.invisionpower.com
| ========================================
| =============================================
| Web: http://www.invisionboard.com
| Email: matt@invisionpower.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
+---------------------------------------------------------------------------
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
+---------------------------------------------------------------------------
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+--------------------------------------------------------------------------
*/
+16 -6
View File
@@ -2,17 +2,27 @@
/*
+--------------------------------------------------------------------------
| 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) $
| > $Revision: 567 $
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
+---------------------------------------------------------------------------
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $Date: 2006-10-31 05:08:21 -0600 (Tue, 31 Oct 2006) $
| > $Revision: 686 $
| > $Author: matt $
+---------------------------------------------------------------------------
|
@@ -81,8 +91,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_editor
@@ -236,7 +246,7 @@ class class_editor
$url = str_replace( '>', '&gt;', $url );
$url = str_replace( ' ', '%20' , $url );
return $type.'="'.$url.'"';
return '<'.$type.'="'.$url.'"';
}
/*-------------------------------------------------------------------------*/
@@ -2,17 +2,27 @@
/*
+--------------------------------------------------------------------------
| 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-04 11:22:28 +0100 (Wed, 04 Oct 2006) $
| > $Revision: 605 $
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
+---------------------------------------------------------------------------
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $Date: 2006-12-04 10:31:02 -0600 (Mon, 04 Dec 2006) $
| > $Revision: 757 $
| > $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_editor_module extends class_editor
@@ -172,9 +182,69 @@ class class_editor_module extends class_editor
//$t = str_replace( '&nbsp;&nbsp;&nbsp;&nbsp;', "\t", $t );
//$t = str_replace( '&nbsp;&nbsp;' , " ", $t );
//-----------------------------------------
// Clean up code tags
//-----------------------------------------
$t = preg_replace_callback( "#\[(code)\](.+?)\[/code\]#is", array( &$this, 'clean_ipb_html_code_tag' ), $t );
//-----------------------------------------
// Clean up quote tags (remove many <br />s
//-----------------------------------------
$t = preg_replace( "#(\[quote([^\]]+?)\])(<br />){1,}#is", "\\1<br />", $t );
//-----------------------------------------
// Clean up the rest of the tags
//-----------------------------------------
$t = $this->ipsclass->txt_htmlspecialchars( $t );
//-----------------------------------------
// Fix up stuff
//-----------------------------------------
$t = str_replace( "&lt;#IMG_DIR#&gt;", "<#IMG_DIR#>", $t );
$t = str_replace( "&lt;#EMO_DIR#&gt;", "<#EMO_DIR#>", $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
//-----------------------------------------
$tag = $matches[1];
$txt = $matches[2];
//-----------------------------------------
// Fix...
//-----------------------------------------
$txt = str_replace( "&lt;br&gt;" , "\n" , $txt );
$txt = str_replace( "&lt;br /&gt;" , "\n" , $txt );
$txt = str_replace( "<br>" , "\n" , $txt );
$txt = str_replace( "<br />" , "\n" , $txt );
$txt = str_replace( "<" , "&lt;" , $txt );
$txt = str_replace( ">" , "&gt;" , $txt );
$txt = str_replace( "&#60;" , "&lt;" , $txt );
$txt = str_replace( "&#62;" , "&gt;" , $txt );
return '['. $tag . ']'.nl2br($txt).'[/'. $tag .']';
}
/*-------------------------------------------------------------------------*/
// Process the raw post with BBCode before saving
/*-------------------------------------------------------------------------*/
@@ -245,14 +315,13 @@ class class_editor_module extends class_editor
// Make URLs safe (prevent tag stripping)
//-----------------------------------------
$t = preg_replace_callback( '#<(a href|img src)=([\'"])([^>]+?)(\\3)#is', array( $this, 'unhtml_url' ), $t );
$t = preg_replace_callback( '#<(a href|img src)=([\'"])([^>]+?)(\\2)#is', array( &$this, 'unhtml_url' ), $t );
//-----------------------------------------
// Make EMOids safe (prevent tag stripping)
//-----------------------------------------
$t = preg_replace_callback( '#(emoid=\")(.+?)(\")#is', array( $this, 'unhtml_emoid' ), $t );
$t = preg_replace_callback( '#(emoid=")(.+?)(")#is', array( &$this, 'unhtml_emoid' ), $t );
//-----------------------------------------
// WYSI-Weirdness #0: BR tags to \n
@@ -310,7 +379,7 @@ class class_editor_module extends class_editor
$t = str_replace( "<#EMO_DIR#>", "&lt;#EMO_DIR&gt;", $t );
# Parse...
$t = preg_replace_callback( "#[ ]?<([^>]+?)emoid=\"(.+?)\"([^>]+?)?".">[ ]?#is", array( $this, 'html_emoid' ), $t );
$t = preg_replace_callback( "#[ ]?<([^>]+?)emoid=\"(.+?)\"([^>]+?)?".">[ ]?#is", array( &$this, 'html_emoid' ), $t );
# And convert it back again...
$t = str_replace( "&lt;#EMO_DIR&gt;", "<#EMO_DIR#>", $t );
@@ -331,6 +400,12 @@ class class_editor_module extends class_editor
$t = preg_replace( "#\[url=(\"|'|&quot;)<a\s+?href=[\"'](.*)/??['\"]\\2/??</a>#is", "[url=\\1\\2", $t );
//-----------------------------------------
// WYSI-Weirdness: Make relative links full links
//-----------------------------------------
$t = preg_replace( "#\[img\](/)?style_(emoticons|images)#i", '[img]' . $this->ipsclass->vars['board_url'] . '/style_' . '\\2', $t );
//-----------------------------------------
// Now, recursively parse the other tags
// to make sure we get the nested ones
@@ -716,7 +791,7 @@ class class_editor_module extends class_editor
// Convert RGB to hex
//-----------------------------------------
$style = preg_replace_callback( '#(?<!\w)color:\s+?rgb\((\d+,\s+?\d+,\s+?\d+)\)(;?)#i', array( $this, '_rgb_to_hex' ), $style );
$style = preg_replace_callback( '#(?<!\w)color:\s+?rgb\((\d+,\s+?\d+,\s+?\d+)\)(;?)#i', array( &$this, '_rgb_to_hex' ), $style );
//-----------------------------------------
// Pick through possible styles
@@ -11,7 +11,13 @@
| Web: http://www.invisionboard.com
| Licence Info: http://www.invisionboard.com/?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 $
+---------------------------------------------------------------------------
@@ -55,8 +61,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_editor_module extends class_editor
+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>
+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>
@@ -28,8 +28,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 customsubs {
@@ -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>
@@ -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>
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+30 -11
View File
@@ -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-11 13:55:47 +0100 (Wed, 11 Oct 2006) $
| > $Revision: 624 $
| > $Author: matt $
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
+---------------------------------------------------------------------------
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $Date: 2006-10-25 13:16:34 -0500 (Wed, 25 Oct 2006) $
| > $Revision: 676 $
| > $Author: bfarber $
+---------------------------------------------------------------------------
|
| > Post Sub-Class
@@ -25,8 +35,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 post_functions extends class_post
@@ -181,10 +191,9 @@ class post_functions extends class_post
//-----------------------------------------
$this->ipsclass->input['TopicTitle'] = $this->pf_clean_topic_title( $this->ipsclass->input['TopicTitle'] );
$this->ipsclass->input['TopicTitle'] = $this->parser->bad_words( $this->ipsclass->input['TopicTitle'] );
$this->ipsclass->input['TopicDesc'] = $this->parser->bad_words( $this->ipsclass->input['TopicDesc'] );
$this->ipsclass->input['TopicDesc'] = trim( $this->parser->bad_words( $this->ipsclass->input['TopicDesc'] ) );
$this->ipsclass->input['TopicDesc'] = $this->ipsclass->txt_mbsubstr( $this->ipsclass->input['TopicDesc'], 0, 70 );
$pinned = 0;
@@ -200,7 +209,7 @@ class post_functions extends class_post
{
$pinned = 1;
$this->moderate_log('Pinned topic from post form', $this->ipsclass->input['TopicTitle']);
$this->moderate_log('Òåìà áûëà «ïîäíÿòà» ïðè åå ïóáëèêàöèè', $this->ipsclass->input['TopicTitle']);
}
}
else if ($this->ipsclass->input['mod_options'] == 'close')
@@ -209,7 +218,7 @@ class post_functions extends class_post
{
$state = 'closed';
$this->moderate_log('Closed topic from post form', $this->ipsclass->input['TopicTitle']);
$this->moderate_log('Òåìà áûëà çàêðûòà ïðè åå ïóáëèêàöèè', $this->ipsclass->input['TopicTitle']);
}
}
else if ($this->ipsclass->input['mod_options'] == 'pinclose')
@@ -219,7 +228,7 @@ class post_functions extends class_post
$pinned = 1;
$state = 'closed';
$this->moderate_log('Pinned & closed topic from post form', $this->ipsclass->input['TopicTitle']);
$this->moderate_log('Òåìà áûëà «ïîäíÿòà» è çàêðûòà ïðè åå ïóáëèêàöèè', $this->ipsclass->input['TopicTitle']);
}
}
}
@@ -402,6 +411,16 @@ class post_functions extends class_post
$raw_post = $this->check_multi_quote();
//-----------------------------------------
// RTE? Convert RIGHT tags that QUOTE would
// have put there
//-----------------------------------------
if ( $this->han_editor->method == 'rte' )
{
$raw_post = $this->parser->convert_ipb_html_to_html( $raw_post );
}
//-----------------------------------------
// Sort out the "raw" textarea input and make it safe incase
// we have a <textarea> tag in the raw post var.
@@ -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-10-11 13:55:47 +0100 (Wed, 11 Oct 2006) $
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
+---------------------------------------------------------------------------
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
+---------------------------------------------------------------------------
| > $Date: 2006-10-11 07:55:47 -0500 (Wed, 11 Oct 2006) $
| > $Revision: 624 $
| > $Author: matt $
+---------------------------------------------------------------------------
@@ -25,7 +35,7 @@
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.";
print "<h1>Íåêîððåêòíûé àäðåñ</h1>Âû íå èìååòå äîñòóïà ê ýòîìó ôàéëó íàïðÿìóþ. Åñëè âû íåäàâíî îáíîâëÿëè ôîðóì, âû äîëæíû îáíîâèòü âñå ñîîòâåòñòâóþùèå ôàéëû.";
exit();
}
@@ -244,7 +254,7 @@ class post_functions extends class_post
{
$this->topic['pinned'] = 1;
$this->moderate_log('Pinned topic from post form', $this->topic['title']);
$this->moderate_log('Òåìà áûëà «ïîäíÿòà» ïðè îòâåòå', $this->topic['title']);
}
}
else if ($this->ipsclass->input['mod_options'] == 'close')
@@ -253,7 +263,7 @@ class post_functions extends class_post
{
$this->topic['state'] = 'closed';
$this->moderate_log('Closed topic from post form', $this->topic['title']);
$this->moderate_log('Òåìà áûëà çàêðûòà ïðè îòâåòå', $this->topic['title']);
}
}
else if ($this->ipsclass->input['mod_options'] == 'move')
@@ -270,7 +280,7 @@ class post_functions extends class_post
$this->topic['pinned'] = 1;
$this->topic['state'] = 'closed';
$this->moderate_log('Pinned & closed topic from post form', $this->topic['title']);
$this->moderate_log('Òåìà áûëà «ïîäíÿòà» è çàêðûòà ïðè îòâåòå', $this->topic['title']);
}
}
}
+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>