Version 2.2.0 RC-1
This commit is contained in:
1 parent
f73f8bff6d
commit
22f1b963ee
1034 files changed
+178610
-70897
No files matched your search
@@ -2,27 +2,17 @@
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board 2.1.7
|
||||
| Invision Power Board
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2005 Invision Power Services, Inc.
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Tuesday 18th of July 2006 05:56:00 PM
|
||||
| Release: 52f408a29988b02f45b5e6f4ba5af0ae
|
||||
| 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-03-06 14:58:13 +0000 (Mon, 06 Mar 2006) $
|
||||
| > $Revision: 161 $
|
||||
| > $Date: 2006-10-17 22:30:46 +0100 (Tue, 17 Oct 2006) $
|
||||
| > $Revision: 652 $
|
||||
| > $Author: bfarber $
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
@@ -62,8 +52,25 @@
|
||||
* @version 2.1
|
||||
* @since 2.1.0
|
||||
*/
|
||||
|
||||
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_bbcode extends class_bbcode_core
|
||||
{
|
||||
var $parse_smilies = 0;
|
||||
var $parse_html = 0;
|
||||
var $parse_bbcode = 0;
|
||||
var $parse_wordwrap = 0;
|
||||
var $parse_nl2br = 1;
|
||||
var $parse_custombbcode = 1;
|
||||
|
||||
var $_image = '';
|
||||
var $_code = '';
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// CONSTRUCTOR
|
||||
/*-------------------------------------------------------------------------*/
|
||||
@@ -100,7 +107,7 @@ class class_bbcode extends class_bbcode_core
|
||||
// Remove session id's from any post
|
||||
//-----------------------------------------
|
||||
|
||||
$txt = preg_replace( "#(\?|&|;|&)s=([0-9a-zA-Z]){32}(&|;|&|$)?#e", "\$this->regex_bash_session('\\1', '\\3')", $txt );
|
||||
$txt = preg_replace_callback( "#(\?|&|;|&)s=([0-9a-zA-Z]){32}(&|;|&|$)?#", array( $this, 'regex_bash_session' ), $txt );
|
||||
|
||||
//-----------------------------------------
|
||||
// convert <br> to \n
|
||||
@@ -113,15 +120,11 @@ class class_bbcode extends class_bbcode_core
|
||||
|
||||
$txt = preg_replace( "/<br>|<br \/>/", "\n", $txt );
|
||||
|
||||
# XSS Clean
|
||||
/*if( $this->strip_hex_entity )
|
||||
{
|
||||
while( preg_match( "/[&|&\;]#x(\w+?);/i", $txt ) )
|
||||
{
|
||||
$txt = preg_replace( "/[&|&\;]#x(\w+?);/ies" , "\$this->regex_bash_hex( '\\1' )" , $txt );
|
||||
}
|
||||
$txt = preg_replace( "#&(?!\;)#", "", $txt );
|
||||
}*/
|
||||
# First we did hex, now we do url encoded
|
||||
# <script
|
||||
$txt = str_replace( "%3C%73%63%72%69%70%74", "<script" , $txt );
|
||||
# document.cookie
|
||||
$txt = str_replace( "%64%6F%63%75%6D%65%6E%74%2E%63%6F%6F%6B%69%65", "document.cookie", $txt );
|
||||
|
||||
$txt = preg_replace( "#javascript\:#is" , "java script:", $txt );
|
||||
$txt = preg_replace( "#vb(.+?)?script\:#is", "vb script:" , $txt );
|
||||
@@ -139,14 +142,14 @@ class class_bbcode extends class_bbcode_core
|
||||
// Do [CODE] tag
|
||||
//-----------------------------------------
|
||||
|
||||
$txt = preg_replace( "#\[code\](.+?)\[/code\]#ies", "\$this->regex_code_tag( '\\1' )", $txt );
|
||||
$txt = preg_replace_callback( "#\[code\](.+?)\[/code\]#is", array( $this, 'regex_code_tag' ), $txt );
|
||||
|
||||
//-----------------------------------------
|
||||
// Do [QUOTE(name,date)] tags
|
||||
//-----------------------------------------
|
||||
|
||||
$txt = preg_replace( "#(\[quote(.+?)?\].*\[/quote\])#ies" , "\$this->regex_parse_quotes('\\1')" , $txt );
|
||||
|
||||
$txt = preg_replace_callback( "#(\[quote(.+?)?\].*\[/quote\])#is" , array( $this, 'regex_parse_quotes' ), $txt );
|
||||
|
||||
// Quote changes \n to br
|
||||
$txt = preg_replace( "/<br>|<br \/>/", "\n", $txt );
|
||||
|
||||
@@ -154,15 +157,15 @@ class class_bbcode extends class_bbcode_core
|
||||
// Auto parse URLs
|
||||
//-----------------------------------------
|
||||
|
||||
$txt = preg_replace( "#(^|\s|>)((http|https|news|ftp)://\w+[^\s\[\]\<]+)#ie" , "\$this->regex_build_url(array('html' => '\\2', 'show' => '\\2', 'st' => '\\1'))", $txt );
|
||||
$txt = preg_replace_callback( "#(^|\s|>)((http|https|news|ftp)://\w+[^\s\[\]\<]+)#i", array( $this, '_regex_build_url_manual' ), $txt );
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// If we are not parsing a siggie, lets have a bash
|
||||
// at the [PHP] [SQL] and [HTML] tags.
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
$txt = preg_replace( "#\[sql\](.+?)\[/sql\]#ies" , "\$this->regex_sql_tag('\\1')" , $txt );
|
||||
$txt = preg_replace( "#\[html\](.+?)\[/html\]#ies" , "\$this->regex_html_tag('\\1')" , $txt );
|
||||
$txt = preg_replace_callback( "#\[sql\](.+?)\[/sql\]#is" , array( $this, 'regex_sql_tag' ), $txt );
|
||||
$txt = preg_replace_callback( "#\[html\](.+?)\[/html\]#is" , array( $this, 'regex_html_tag' ), $txt );
|
||||
|
||||
//-----------------------------------------
|
||||
// left, right, center
|
||||
@@ -183,14 +186,14 @@ class class_bbcode extends class_bbcode_core
|
||||
// [LIST] [*] [/LIST]
|
||||
//-----------------------------------------
|
||||
|
||||
while( preg_match( "#\n?\[list\](.+?)\[/list\]\n?#ies" , $txt ) )
|
||||
while( preg_match( "#\n?\[list\](.+?)\[/list\]\n?#is" , $txt ) )
|
||||
{
|
||||
$txt = preg_replace( "#\n?\[list\](.+?)\[/list\]\n?#ies", "\$this->regex_list('\\1')" , $txt );
|
||||
$txt = preg_replace_callback( "#\n?\[list\](.+?)\[/list\]\n?#is", array( $this, 'regex_list' ), $txt );
|
||||
}
|
||||
|
||||
while( preg_match( "#\n?\[list=(a|A|i|I|1)\](.+?)\[/list\]\n?#ies" , $txt ) )
|
||||
while( preg_match( "#\n?\[list=(a|A|i|I|1)\](.+?)\[/list\]\n?#is" , $txt ) )
|
||||
{
|
||||
$txt = preg_replace( "#\n?\[list=(a|A|i|I|1)\](.+?)\[/list\]\n?#ies", "\$this->regex_list('\\2','\\1')" , $txt );
|
||||
$txt = preg_replace_callback( "#\n?\[list=(a|A|i|I|1)\](.+?)\[/list\]\n?#is", array( $this, 'regex_list' ), $txt );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -199,18 +202,20 @@ class class_bbcode extends class_bbcode_core
|
||||
|
||||
if ( $this->ipsclass->vars['allow_images'] )
|
||||
{
|
||||
$txt = preg_replace( "#\[img\](.+?)\[/img\]#ie" , "\$this->regex_check_image('\\1')" , $txt );
|
||||
$txt = preg_replace( "#(\[flash=)(\S+?)(\,)(\S+?)(\])(\S+?)(\[\/flash\])#ie", "\$this->regex_check_flash('\\2','\\4','\\6')", $txt );
|
||||
$txt = preg_replace_callback( "#\[img\](.+?)\[/img\]#i" , array( $this, 'regex_check_image' ), $txt );
|
||||
$txt = preg_replace_callback( "#(\[flash=)(\S+?)(\,)(\S+?)(\])(\S+?)(\[\/flash\])#i", array( $this, 'regex_check_flash' ), $txt );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Start off with the easy stuff
|
||||
//-----------------------------------------
|
||||
|
||||
$txt = preg_replace( "#\[b\](.+?)\[/b\]#is", "<b>\\1</b>", $txt );
|
||||
$txt = preg_replace( "#\[i\](.+?)\[/i\]#is", "<i>\\1</i>", $txt );
|
||||
$txt = preg_replace( "#\[u\](.+?)\[/u\]#is", "<u>\\1</u>", $txt );
|
||||
$txt = preg_replace( "#\[s\](.+?)\[/s\]#is", "<strike>\\1</strike>", $txt );
|
||||
$txt = $this->parse_simple_tag_recursively( 'b' , 'b' , 1, $txt );
|
||||
$txt = $this->parse_simple_tag_recursively( 'i' , 'i' , 1, $txt );
|
||||
$txt = $this->parse_simple_tag_recursively( 'u' , 'u' , 1, $txt );
|
||||
$txt = $this->parse_simple_tag_recursively( 's' , 'strike', 1, $txt );
|
||||
$txt = $this->parse_simple_tag_recursively( 'sub', 'sub' , 1, $txt );
|
||||
$txt = $this->parse_simple_tag_recursively( 'sup', 'sup' , 1, $txt );
|
||||
|
||||
//-----------------------------------------
|
||||
// (c) (r) and (tm)
|
||||
@@ -234,9 +239,9 @@ class class_bbcode extends class_bbcode_core
|
||||
// [url=http://www.index.com]ibforums![/url]
|
||||
//-----------------------------------------
|
||||
|
||||
$txt = preg_replace( "#\[url\](\S+?)\[/url\]#ie" , "\$this->regex_build_url(array('html' => '\\1', 'show' => '\\1'))", $txt );
|
||||
$txt = preg_replace( "#\[url\s*=\s*\"\;\s*(\S+?)\s*\"\;\s*\](.*?)\[\/url\]#ie" , "\$this->regex_build_url(array('html' => '\\1', 'show' => '\\2'))", $txt );
|
||||
$txt = preg_replace( "#\[url\s*=\s*(\S+?)\s*\](.*?)\[\/url\]#ie" , "\$this->regex_build_url(array('html' => '\\1', 'show' => '\\2'))", $txt );
|
||||
$txt = preg_replace_callback( "#\[url\](.*?)\[/url\]#is" , array( $this, '_regex_build_url_tags'), $txt );
|
||||
$txt = preg_replace_callback( "#\[url\s*=\s*(?:\"\;|\")\s*(.*?)\s*(?:\"\;|\")\s*\](.*?)\[\/url\]#is", array( $this, '_regex_build_url_tags'), $txt );
|
||||
$txt = preg_replace_callback( "#\[url\s*=\s*(.*?)\s*\](.*?)\[\/url\]#is" , array( $this, '_regex_build_url_tags'), $txt );
|
||||
|
||||
//-----------------------------------------
|
||||
// font size, colour and font style
|
||||
@@ -246,24 +251,24 @@ class class_bbcode extends class_bbcode_core
|
||||
// [background=color]Text here[/background]
|
||||
//-----------------------------------------
|
||||
|
||||
while ( preg_match( "#\[background=([^\]]+)\](.+?)\[/background\]#ies", $txt ) )
|
||||
while ( preg_match( "#\[background=([^\]]+)\](.+?)\[/background\]#is", $txt ) )
|
||||
{
|
||||
$txt = preg_replace( "#\[background=([^\]]+)\](.+?)\[/background\]#ies", "\$this->regex_font_attr(array('s'=>'background','1'=>'\\1','2'=>'\\2'))", $txt );
|
||||
$txt = preg_replace_callback( "#\[background=([^\]]+)\](.+?)\[/background\]#is", array( $this, '_regex_font_attr_background' ), $txt );
|
||||
}
|
||||
|
||||
while ( preg_match( "#\[size=([^\]]+)\](.+?)\[/size\]#ies", $txt ) )
|
||||
while ( preg_match( "#\[size=([^\]]+)\](.+?)\[/size\]#is", $txt ) )
|
||||
{
|
||||
$txt = preg_replace( "#\[size=([^\]]+)\](.+?)\[/size\]#ies" , "\$this->regex_font_attr(array('s'=>'size','1'=>'\\1','2'=>'\\2'))", $txt );
|
||||
$txt = preg_replace_callback( "#\[size=([^\]]+)\](.+?)\[/size\]#is" , array( $this, '_regex_font_attr_size' ), $txt );
|
||||
}
|
||||
|
||||
while ( preg_match( "#\[font=([^\]]+)\](.+?)\[/font\]#ies", $txt ) )
|
||||
while ( preg_match( "#\[font=([^\]]+)\](.+?)\[/font\]#is", $txt ) )
|
||||
{
|
||||
$txt = preg_replace( "#\[font=([^\]]+)\](.+?)\[/font\]#ies" , "\$this->regex_font_attr(array('s'=>'font','1'=>'\\1','2'=>'\\2'))", $txt );
|
||||
$txt = preg_replace_callback( "#\[font=([^\]]+)\](.+?)\[/font\]#is" , array( $this, '_regex_font_attr_font' ), $txt );
|
||||
}
|
||||
|
||||
while( preg_match( "#\[color=([^\]]+)\](.+?)\[/color\]#ies", $txt ) )
|
||||
while( preg_match( "#\[color=([^\]]+)\](.+?)\[/color\]#is", $txt ) )
|
||||
{
|
||||
$txt = preg_replace( "#\[color=([^\]]+)\](.+?)\[/color\]#ies" , "\$this->regex_font_attr(array('s'=>'col' ,'1'=>'\\1','2'=>'\\2'))", $txt );
|
||||
$txt = preg_replace_callback( "#\[color=([^\]]+)\](.+?)\[/color\]#is" , array( $this, '_regex_font_attr_color' ), $txt );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -271,8 +276,8 @@ class class_bbcode extends class_bbcode_core
|
||||
// Swap \n back to <br>
|
||||
//-----------------------------------------
|
||||
|
||||
$txt = preg_replace( "/\n/", "<br />", $txt );
|
||||
|
||||
$txt = str_replace( "\n", "<br />", $txt );
|
||||
|
||||
//-----------------------------------------
|
||||
// Unicode?
|
||||
//-----------------------------------------
|
||||
@@ -290,27 +295,35 @@ class class_bbcode extends class_bbcode_core
|
||||
if ( $this->parse_smilies )
|
||||
{
|
||||
$txt = ' '.$txt.' ';
|
||||
|
||||
usort( $this->ipsclass->cache['emoticons'] , array( 'class_bbcode_core', 'smilie_length_sort' ) );
|
||||
|
||||
$codes_seen = array();
|
||||
|
||||
if ( count( $this->ipsclass->cache['emoticons'] ) > 0 )
|
||||
{
|
||||
foreach( $this->ipsclass->cache['emoticons'] as $a_id => $row)
|
||||
foreach( $this->ipsclass->cache['emoticons'] as $row)
|
||||
{
|
||||
if ( $row['emo_set'] != $this->ipsclass->skin['_emodir'] )
|
||||
if ( is_array($this->ipsclass->skin) AND $this->ipsclass->skin['_emodir'] AND $row['emo_set'] != $this->ipsclass->skin['_emodir'] )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$code = $row['typed'];
|
||||
$image = $row['image'];
|
||||
|
||||
if ( in_array( $code, $codes_seen ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$codes_seen[] = $code;
|
||||
|
||||
//-----------------------------------------
|
||||
// Make safe for regex
|
||||
//-----------------------------------------
|
||||
$code = preg_quote($code, "/");
|
||||
|
||||
$txt = preg_replace( "!(?<=[^\w&;/\"])$code(?=.\W|\"|\W.|\W$)!ei", "\$this->convert_emoticon('$code', '$image')", $txt );
|
||||
|
||||
$this->_code = preg_quote($code, "/");
|
||||
$this->_image = $row['image'];
|
||||
|
||||
$txt = preg_replace_callback( "!(?<=[^\w&;/\"])".$this->_code."(?=.\W|\"|\W.|\W$)!i", array( $this, 'convert_emoticon' ), $txt );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -370,7 +383,13 @@ class class_bbcode extends class_bbcode_core
|
||||
// Fix up <br /> in URLs
|
||||
//-----------------------------------------
|
||||
|
||||
$t = preg_replace( "#(<a href=[\"'])(.+?)([\"'])#ise", "\$this->_clean_long_url('\\1', '\\2', '\\3')", $t );
|
||||
$t = preg_replace_callback( "#(<a href=[\"'])(.+?)([\"'])#is", array( $this, '_clean_long_url' ), $t );
|
||||
|
||||
//-----------------------------------------
|
||||
// Fix up <br /> in IMGs
|
||||
//-----------------------------------------
|
||||
|
||||
$t = preg_replace_callback( "#(<img src=[\"'])(.+?)([\"'])#is", array( $this, '_clean_long_url' ), $t );
|
||||
|
||||
//-----------------------------------------
|
||||
// Custom BB code
|
||||
@@ -407,7 +426,7 @@ class class_bbcode extends class_bbcode_core
|
||||
$txt = str_replace( "<#EMO_DIR#>", "<#EMO_DIR>", $txt );
|
||||
|
||||
# New emo
|
||||
$txt = preg_replace( "#<([^>]+?)emoid=\"(.+?)\"([^>]+?)".">#is", "\\2", $txt );
|
||||
$txt = preg_replace( "#<([^>]+?)emoid=\"(.+?)\"([^>]*?)".">#is", "\\2", $txt );
|
||||
|
||||
# And convert it back again...
|
||||
$txt = str_replace( "<#EMO_DIR>", "<#EMO_DIR#>", $txt );
|
||||
@@ -428,20 +447,20 @@ class class_bbcode extends class_bbcode_core
|
||||
// SQL
|
||||
//-----------------------------------------
|
||||
|
||||
$txt = preg_replace( "#<!--sql-->(.+?)<!--sql1-->(.+?)<!--sql2-->(.+?)<!--sql3-->#eis", "\$this->unconvert_sql(\"\\2\")", $txt);
|
||||
$txt = preg_replace_callback( "#<!--sql-->(.+?)<!--sql1-->(.+?)<!--sql2-->(.+?)<!--sql3-->#is", array( $this, 'unconvert_sql'), $txt );
|
||||
|
||||
//-----------------------------------------
|
||||
// HTML
|
||||
//-----------------------------------------
|
||||
|
||||
$txt = preg_replace( "#<!--html-->(.+?)<!--html1-->(.+?)<!--html2-->(.+?)<!--html3-->#ise", "\$this->unconvert_htm(\"\\2\")", $txt);
|
||||
$txt = preg_replace_callback( "#<!--html-->(.+?)<!--html1-->(.+?)<!--html2-->(.+?)<!--html3-->#is", array( $this, 'unconvert_htm'), $txt );
|
||||
|
||||
//-----------------------------------------
|
||||
// Images / Flash
|
||||
//-----------------------------------------
|
||||
|
||||
$txt = preg_replace( "#<!--Flash (.+?)-->.+?<!--End Flash-->#e", "\$this->unconvert_flash('\\1')", $txt );
|
||||
$txt = preg_replace( "#<img src=[\"'](\S+?)['\"].+?".">#" , "\[img\]\\1\[/img\]" , $txt );
|
||||
$txt = preg_replace_callback( "#<!--Flash (.+?)-->.+?<!--End Flash-->#", array( $this, 'unconvert_flash'), $txt );
|
||||
$txt = preg_replace( "#<img+?src=[\"'](\S+?)['\"].+?".">#" , "\[img\]\\1\[/img\]" , $txt );
|
||||
|
||||
//-----------------------------------------
|
||||
// Email, URLs
|
||||
@@ -463,7 +482,7 @@ class class_bbcode extends class_bbcode_core
|
||||
// New quote
|
||||
//-----------------------------------------
|
||||
|
||||
$txt = preg_replace( "#<!--quoteo([^>]+?)?-->(.+?)<!--quotec-->#sie", "\$this->_parse_new_quote('\\1', '\\2' )" , $txt );
|
||||
$txt = preg_replace_callback( "#<!--quoteo([^>]+?)?-->(.+?)<!--quotec-->#si", array( $this, '_parse_new_quote'), $txt );
|
||||
|
||||
//-----------------------------------------
|
||||
// left, right, center
|
||||
@@ -488,20 +507,23 @@ class class_bbcode extends class_bbcode_core
|
||||
$txt = preg_replace( "#<!--c2-->(.+?)<!--ec2-->#", '[/code]', $txt );
|
||||
|
||||
//-----------------------------------------
|
||||
// Easy peasy
|
||||
// Start off with the easy stuff
|
||||
//-----------------------------------------
|
||||
|
||||
$txt = preg_replace( "#<i>(.+?)</i>#is" , "\[i\]\\1\[/i\]" , $txt );
|
||||
$txt = preg_replace( "#<b>(.+?)</b>#is" , "\[b\]\\1\[/b\]" , $txt );
|
||||
$txt = preg_replace( "#<strike>(.+?)</strike>#is" , "\[s\]\\1\[/s\]" , $txt );
|
||||
$txt = preg_replace( "#<u>(.+?)</u>#is" , "\[u\]\\1\[/u\]" , $txt );
|
||||
$txt = $this->parse_simple_tag_recursively( 'b' , 'b' , 0, $txt );
|
||||
$txt = $this->parse_simple_tag_recursively( 'i' , 'i' , 0, $txt );
|
||||
$txt = $this->parse_simple_tag_recursively( 'u' , 'u' , 0, $txt );
|
||||
$txt = $this->parse_simple_tag_recursively( 'strike', 's' , 0, $txt );
|
||||
$txt = $this->parse_simple_tag_recursively( 'sub' , 'sub', 0, $txt );
|
||||
$txt = $this->parse_simple_tag_recursively( 'sup' , 'sup', 0, $txt );
|
||||
|
||||
//-----------------------------------------
|
||||
// List headache
|
||||
//-----------------------------------------
|
||||
|
||||
$txt = preg_replace( "#(\n){0,}<ul>#" , "\\1\[list\]" , $txt );
|
||||
$txt = preg_replace( "#(\n){0,}<ol type='(a|A|i|I|1)'>#" , "\\1\[list=\\2\]\n" , $txt );
|
||||
$txt = preg_replace( "#(\n){0,}<ol>#" , "\\1\[list=1\]" , $txt );
|
||||
$txt = preg_replace( "#(\n){0,}<ol type=[\"'](a|A|i|I|1)[\"']>#" , "\\1\[list=\\2\]\n" , $txt );
|
||||
$txt = preg_replace( "#(\n){0,}<li>#" , "\n\[*\]" , $txt );
|
||||
$txt = preg_replace( "#(\n){0,}</ul>(\n){0,}#", "\n\[/list\]\\2" , $txt );
|
||||
$txt = preg_replace( "#(\n){0,}</ol>(\n){0,}#", "\n\[/list\]\\2" , $txt );
|
||||
@@ -528,24 +550,33 @@ class class_bbcode extends class_bbcode_core
|
||||
// LEGACY SPAN TAGS
|
||||
//-----------------------------------------
|
||||
|
||||
while ( preg_match( "#<span style=['\"]font-size:(.+?)pt;line-height:100%['\"]>(.+?)</span>#is", $txt ) )
|
||||
//-----------------------------------------
|
||||
// WYSI-Weirdness #9923464: Opera span tags
|
||||
//-----------------------------------------
|
||||
|
||||
while ( preg_match( "#<span style='font-family: \"(.+?)\"'>(.+?)</span>#is", $txt ) )
|
||||
{
|
||||
$txt = preg_replace( "#<span style=['\"]font-size:(.+?)pt;line-height:100%['\"]>(.+?)</span>#ise" , "\$this->unconvert_size('\\1', '\\2')", $txt );
|
||||
$txt = preg_replace( "#<span style='font-family: \"(.+?)\"'>(.+?)</span>#is", "\[font=\\1\]\\2\[/font\]", $txt );
|
||||
}
|
||||
|
||||
while ( preg_match( "#<span style=['\"]font-size:?\s+?(.+?)pt;?\s+?line-height:?\s+?100%['\"]>(.+?)</span>#is", $txt ) )
|
||||
{
|
||||
$txt = preg_replace_callback( "#<span style=['\"]font-size:?\s+?(.+?)pt;?\s+?line-height:?\s+?100%['\"]>(.+?)</span>#is" , array( $this, 'unconvert_size' ), $txt );
|
||||
}
|
||||
|
||||
while ( preg_match( "#<span style=['\"]color:(.+?)['\"]>(.+?)</span>#is", $txt ) )
|
||||
while ( preg_match( "#<span style=['\"]color:?\s+?(.+?)['\"]>(.+?)</span>#is", $txt ) )
|
||||
{
|
||||
$txt = preg_replace( "#<span style=['\"]color:(.+?)['\"]>(.+?)</span>#is" , "\[color=\\1\]\\2\[/color\]", $txt );
|
||||
$txt = preg_replace( "#<span style=['\"]color:?\s+?(.+?)['\"]>(.+?)</span>#is" , "\[color=\\1\]\\2\[/color\]", $txt );
|
||||
}
|
||||
|
||||
while ( preg_match( "#<span style=['\"]font-family:(.+?)['\"]>(.+?)</span>#is", $txt ) )
|
||||
while ( preg_match( "#<span style=['\"]font-family:?\s+?(.+?)['\"]>(.+?)</span>#is", $txt ) )
|
||||
{
|
||||
$txt = preg_replace( "#<span style=['\"]font-family:(.+?)['\"]>(.+?)</span>#is", "\[font=\\1\]\\2\[/font\]", $txt );
|
||||
$txt = preg_replace( "#<span style=['\"]font-family:?\s+?(.+?)['\"]>(.+?)</span>#is", "\[font=\\1\]\\2\[/font\]", $txt );
|
||||
}
|
||||
|
||||
while ( preg_match( "#<span style=['\"]background-color:(.+?)['\"]>(.+?)</span>#is", $txt ) )
|
||||
while ( preg_match( "#<span style=['\"]background-color:?\s+?(.+?)['\"]>(.+?)</span>#is", $txt ) )
|
||||
{
|
||||
$txt = preg_replace( "#<span style=['\"]background-color:(.+?)['\"]>(.+?)</span>#is", "\[background=\\1\]\\2\[/font\]", $txt );
|
||||
$txt = preg_replace( "#<span style=['\"]background-color:?\s+?(.+?)['\"]>(.+?)</span>#is", "\[background=\\1\]\\2\[/font\]", $txt );
|
||||
}
|
||||
|
||||
# Legacy <strike>
|
||||
@@ -587,8 +618,15 @@ class class_bbcode extends class_bbcode_core
|
||||
* @param string Emo Image URL
|
||||
* @return string Converted text
|
||||
*/
|
||||
function convert_emoticon($code="", $image="")
|
||||
function convert_emoticon( $matches=array() )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$code = $this->_code;
|
||||
$image = $this->_image;
|
||||
|
||||
if ( ! $code or ! $image )
|
||||
{
|
||||
return;
|
||||
@@ -635,6 +673,7 @@ class class_bbcode extends class_bbcode_core
|
||||
//-----------------------------------------
|
||||
|
||||
$style = str_replace( '"', '', $style );
|
||||
$style = str_replace( '"' , '', $style );
|
||||
|
||||
//-----------------------------------------
|
||||
// Make safe
|
||||
@@ -646,9 +685,9 @@ class class_bbcode extends class_bbcode_core
|
||||
// Size
|
||||
//-----------------------------------------
|
||||
|
||||
if ($type == 'size')
|
||||
if ( $type == 'size' )
|
||||
{
|
||||
$style = intval($style);
|
||||
$style = intval( stripslashes( $style ) );
|
||||
$real = $this->convert_bbsize_to_realsize( $style );
|
||||
|
||||
return "<!--sizeo:{$style}--><span style=\"font-size:".$real."pt;line-height:100%\"><!--/sizeo-->".$text."<!--sizec--></span><!--/sizec-->";
|
||||
@@ -681,7 +720,15 @@ class class_bbcode extends class_bbcode_core
|
||||
else if ($type == 'font')
|
||||
{
|
||||
$style = preg_replace( "/[^\d\w\#\-\_\s]/s", "", $style );
|
||||
return "<!--fonto:{$style}--><span style=\"font-family:".$style."\"><!--/fonto-->".$text."<!--fontc--></span><!--/fontc-->";
|
||||
|
||||
if( $this->ipsclass->browser['browser'] == 'opera' )
|
||||
{
|
||||
return "<!--fonto:{$style}--><span style='font-family: \"".$style."\"'><!--/fonto-->".$text."<!--fontc--></span><!--/fontc-->";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "<!--fonto:{$style}--><span style=\"font-family:".$style."\"><!--/fonto-->".$text."<!--fontc--></span><!--/fontc-->";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -697,11 +744,11 @@ class class_bbcode extends class_bbcode_core
|
||||
* @param string SANS URL
|
||||
* @return string Converted text
|
||||
*/
|
||||
function _clean_long_url( $before, $url, $after )
|
||||
function _clean_long_url( $matches=array() )
|
||||
{
|
||||
$before = stripslashes( $before );
|
||||
$url = stripslashes( $url );
|
||||
$after = stripslashes( $after );
|
||||
$before = stripslashes( $matches[1] );
|
||||
$url = stripslashes( $matches[2] );
|
||||
$after = stripslashes( $matches[3] );
|
||||
|
||||
return $before . str_replace( '<br />', '', str_replace( "? ", "?", $url ) ) . $after;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -2,28 +2,18 @@
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board 2.1.7
|
||||
| Invision Power Board
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2005 Invision Power Services, Inc.
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Tuesday 18th of July 2006 05:56:00 PM
|
||||
| Release: 52f408a29988b02f45b5e6f4ba5af0ae
|
||||
| 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: 2005-10-24 22:17:00 +0100 (Mon, 24 Oct 2005) $
|
||||
| > $Revision: 64 $
|
||||
| > $Author: bfarber $
|
||||
| > $Date: 2006-09-22 11:28:54 +0100 (Fri, 22 Sep 2006) $
|
||||
| > $Revision: 567 $
|
||||
| > $Author: matt $
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > BB Code LEGACY Module
|
||||
@@ -60,8 +50,22 @@
|
||||
* @version 2.1
|
||||
* @ignore
|
||||
*/
|
||||
|
||||
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_bbcode extends class_bbcode_core
|
||||
{
|
||||
var $parse_smilies = 0;
|
||||
var $parse_html = 0;
|
||||
var $parse_bbcode = 0;
|
||||
var $parse_wordwrap = 0;
|
||||
var $parse_nl2br = 1;
|
||||
var $parse_custombbcode = 1;
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// CONSTRUCTOR
|
||||
/*-------------------------------------------------------------------------*/
|
||||
@@ -231,19 +235,26 @@ class class_bbcode extends class_bbcode_core
|
||||
if ( $this->parse_smilies )
|
||||
{
|
||||
$txt = ' '.$txt.' ';
|
||||
|
||||
usort( $this->ipsclass->cache['emoticons'] , array( 'post_parser', 'smilie_length_sort' ) );
|
||||
$codes_seen = array();
|
||||
|
||||
if ( count( $this->ipsclass->cache['emoticons'] ) > 0 )
|
||||
{
|
||||
foreach( $this->ipsclass->cache['emoticons'] as $a_id => $row)
|
||||
foreach( $this->ipsclass->cache['emoticons'] as $row)
|
||||
{
|
||||
if ( $row['emo_set'] != $this->ipsclass->skin['_emodir'] )
|
||||
if ( $this->ipsclass->skin['_emodir'] && $row['emo_set'] != $this->ipsclass->skin['_emodir'] )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$code = $row['typed'];
|
||||
|
||||
if( in_array( $code, $codes_seen ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$codes_seen[] = $code;
|
||||
|
||||
$image = $row['image'];
|
||||
|
||||
//-----------------------------------------
|
||||
|
||||
@@ -1,15 +1 @@
|
||||
<html>
|
||||
<head><title>Ошибка < Русская версия Invision Power Board</title></head>
|
||||
<body>
|
||||
<h1>Ошибка < Русская версия Invision Power Board</h1>
|
||||
<hr>
|
||||
Вы попали на несуществующую страницу!<br>Пожалуйста нажмите на кнопочку «<b>Назад</b>»
|
||||
в вашем браузере для возвращения на предыдущую страницу.
|
||||
<hr>
|
||||
<b>Invision Power Board:</b>
|
||||
<ul>
|
||||
<li><a href="http://www.bestwarez.ru" title="BestWarez.Ru - Только лучший Варез!">Русская версия</a></li>
|
||||
<li><a href="http://www.invisionboard.com" title="Official Site">English version</a></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
<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>␍
|
||||
Reference in new issue
Block a user