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
@@ -1,28 +1,18 @@
|
||||
<?php
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| 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-10-16 13:01:42 +0100 (Mon, 16 Oct 2006) $
|
||||
| > $Revision: 649 $
|
||||
| > $Author: matt $
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > Handler for BBCode parsing
|
||||
@@ -31,6 +21,12 @@
|
||||
+--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class parse_bbcode
|
||||
{
|
||||
# Global
|
||||
@@ -45,12 +41,14 @@ class parse_bbcode
|
||||
var $pre_db_parse_method = 'new';
|
||||
|
||||
# Permissions
|
||||
var $parse_smilies = 0;
|
||||
var $parse_html = 0;
|
||||
var $parse_bbcode = 1;
|
||||
var $strip_quotes = 1;
|
||||
var $parse_n12br = 1;
|
||||
var $bypass_badwords = 0;
|
||||
var $parse_smilies = 0;
|
||||
var $parse_html = 0;
|
||||
var $parse_bbcode = 1;
|
||||
var $strip_quotes = 1;
|
||||
var $parse_nl2br = 1;
|
||||
var $bypass_badwords = 0;
|
||||
var $parse_custombbcode = 1;
|
||||
var $parsing_signature = 0;
|
||||
|
||||
# Error
|
||||
var $error;
|
||||
@@ -80,31 +78,33 @@ class parse_bbcode
|
||||
|
||||
$class = "";
|
||||
|
||||
//-----------------------------------------
|
||||
// Get the correct class
|
||||
//-----------------------------------------
|
||||
|
||||
$this->_load_classes();
|
||||
|
||||
//-----------------------------------------
|
||||
// Check the DB cache
|
||||
//-----------------------------------------
|
||||
|
||||
$this->check_caches();
|
||||
|
||||
//-----------------------------------------
|
||||
// Get the correct class
|
||||
//-----------------------------------------
|
||||
|
||||
$this->_load_classes();
|
||||
|
||||
//-----------------------------------------
|
||||
// Decide the settings...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->bbclass->bypass_badwords = $this->bypass_badwords ? $this->bypass_badwords : intval($this->ipsclass->member['g_bypass_badwords']);
|
||||
$this->bbclass->parse_smilies = $this->parse_smilies;
|
||||
$this->bbclass->parse_html = $this->parse_html;
|
||||
$this->bbclass->parse_bbcode = $this->parse_bbcode;
|
||||
$this->bbclass->strip_quotes = $this->ipsclass->vars['strip_quotes'];
|
||||
$this->bbclass->parse_n12br = $this->parse_n12br;
|
||||
$this->bbclass->parse_wordwrap = $this->ipsclass->vars['post_wordwrap'];
|
||||
$this->bbclass->max_embed_quotes = $this->ipsclass->vars['max_quotes_per_post'];
|
||||
|
||||
$this->bbclass->bypass_badwords = $this->bypass_badwords ? $this->bypass_badwords : intval($this->ipsclass->member['g_bypass_badwords']);
|
||||
$this->bbclass->parse_smilies = $this->parse_smilies;
|
||||
$this->bbclass->parse_html = $this->parse_html;
|
||||
$this->bbclass->parse_bbcode = $this->parse_bbcode;
|
||||
$this->bbclass->strip_quotes = $this->ipsclass->vars['strip_quotes'];
|
||||
$this->bbclass->parse_nl2br = $this->parse_nl2br;
|
||||
$this->bbclass->parse_wordwrap = $this->ipsclass->vars['post_wordwrap'];
|
||||
$this->bbclass->max_embed_quotes = $this->ipsclass->vars['max_quotes_per_post'];
|
||||
$this->bbclass->parse_custombbcode = $this->parse_custombbcode;
|
||||
$this->bbclass->parsing_signature = $this->parsing_signature;
|
||||
|
||||
//-----------------------------------------
|
||||
// Parse
|
||||
//-----------------------------------------
|
||||
@@ -140,15 +140,17 @@ class parse_bbcode
|
||||
// Decide the settings...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->bbclass->bypass_badwords = $this->bypass_badwords ? $this->bypass_badwords : intval($this->ipsclass->member['g_bypass_badwords']);
|
||||
$this->bbclass->parse_smilies = $this->parse_smilies;
|
||||
$this->bbclass->parse_html = $this->parse_html;
|
||||
$this->bbclass->parse_bbcode = $this->parse_bbcode;
|
||||
$this->bbclass->strip_quotes = $this->ipsclass->vars['strip_quotes'];
|
||||
$this->bbclass->parse_n12br = $this->parse_n12br;
|
||||
$this->bbclass->parse_wordwrap = $this->ipsclass->vars['post_wordwrap'];
|
||||
$this->bbclass->max_embed_quotes = $this->ipsclass->vars['max_quotes_per_post'];
|
||||
|
||||
$this->bbclass->bypass_badwords = $this->bypass_badwords ? $this->bypass_badwords : intval($this->ipsclass->member['g_bypass_badwords']);
|
||||
$this->bbclass->parse_smilies = $this->parse_smilies;
|
||||
$this->bbclass->parse_html = $this->parse_html;
|
||||
$this->bbclass->parse_bbcode = $this->parse_bbcode;
|
||||
$this->bbclass->strip_quotes = $this->ipsclass->vars['strip_quotes'];
|
||||
$this->bbclass->parse_nl2br = $this->parse_nl2br;
|
||||
$this->bbclass->parse_wordwrap = $this->ipsclass->vars['post_wordwrap'];
|
||||
$this->bbclass->max_embed_quotes = $this->ipsclass->vars['max_quotes_per_post'];
|
||||
$this->bbclass->parse_custombbcode = $this->parse_custombbcode;
|
||||
$this->bbclass->parsing_signature = $this->parsing_signature;
|
||||
|
||||
//-----------------------------------------
|
||||
// Parse
|
||||
//-----------------------------------------
|
||||
@@ -185,15 +187,17 @@ class parse_bbcode
|
||||
// Decide the settings...
|
||||
//-----------------------------------------
|
||||
|
||||
$this->bbclass->bypass_badwords = $this->bypass_badwords ? $this->bypass_badwords : intval($this->ipsclass->member['g_bypass_badwords']);
|
||||
$this->bbclass->parse_smilies = $this->parse_smilies;
|
||||
$this->bbclass->parse_html = $this->parse_html;
|
||||
$this->bbclass->parse_bbcode = $this->parse_bbcode;
|
||||
$this->bbclass->strip_quotes = $this->ipsclass->vars['strip_quotes'];
|
||||
$this->bbclass->parse_nl2br = $this->parse_nl2br;
|
||||
$this->bbclass->parse_wordwrap = $this->ipsclass->vars['post_wordwrap'];
|
||||
$this->bbclass->max_embed_quotes = $this->ipsclass->vars['max_quotes_per_post'];
|
||||
|
||||
$this->bbclass->bypass_badwords = $this->bypass_badwords ? $this->bypass_badwords : intval($this->ipsclass->member['g_bypass_badwords']);
|
||||
$this->bbclass->parse_smilies = $this->parse_smilies;
|
||||
$this->bbclass->parse_html = $this->parse_html;
|
||||
$this->bbclass->parse_bbcode = $this->parse_bbcode;
|
||||
$this->bbclass->strip_quotes = $this->ipsclass->vars['strip_quotes'];
|
||||
$this->bbclass->parse_nl2br = $this->parse_nl2br;
|
||||
$this->bbclass->parse_wordwrap = $this->ipsclass->vars['post_wordwrap'];
|
||||
$this->bbclass->max_embed_quotes = $this->ipsclass->vars['max_quotes_per_post'];
|
||||
$this->bbclass->parse_custombbcode = $this->parse_custombbcode;
|
||||
$this->bbclass->parsing_signature = $this->parsing_signature;
|
||||
|
||||
//-----------------------------------------
|
||||
// Parse
|
||||
//-----------------------------------------
|
||||
@@ -294,7 +298,7 @@ class parse_bbcode
|
||||
|
||||
$this->_load_classes();
|
||||
|
||||
$this->bbclass->bypass_badwords = $this->bypass_badwords ? $this->bypass_badwords : intval($this->ipsclass->member['g_bypass_badwords']);
|
||||
$this->bbclass->bypass_badwords = isset( $this->bypass_badwords ) ? $this->bypass_badwords : intval($this->ipsclass->member['g_bypass_badwords']);
|
||||
|
||||
return $this->bbclass->bad_words( $t );
|
||||
}
|
||||
@@ -316,13 +320,13 @@ class parse_bbcode
|
||||
// [url=http://www.index.com]ibforums![/url]
|
||||
//-----------------------------------------
|
||||
|
||||
$txt = preg_replace( "#\[url\](\S+?)\[/url\]#ie" , "\$this->bbclass->regex_build_url(array('html' => '\\1', 'show' => '\\1'))", $txt );
|
||||
$txt = preg_replace( "#\[url\s*=\s*\"\;\s*(\S+?)\s*\"\;\s*\](.*?)\[\/url\]#ie" , "\$this->bbclass->regex_build_url(array('html' => '\\1', 'show' => '\\2'))", $txt );
|
||||
$txt = preg_replace( "#\[url\s*=\s*(\S+?)\s*\](.*?)\[\/url\]#ie" , "\$this->bbclass->regex_build_url(array('html' => '\\1', 'show' => '\\2'))", $txt );
|
||||
|
||||
$txt = preg_replace_callback( "#\[url\](.*?)\[/url\]#is" , array( $this->bbclass, '_regex_build_url_tags'), $txt );
|
||||
$txt = preg_replace_callback( "#\[url\s*=\s*(?:\"\;|\")\s*(.*?)\s*(?:\"\;|\")\s*\](.*?)\[\/url\]#is", array( $this->bbclass, '_regex_build_url_tags'), $txt );
|
||||
$txt = preg_replace_callback( "#\[url\s*=\s*(.*?)\s*\](.*?)\[\/url\]#is" , array( $this->bbclass, '_regex_build_url_tags'), $txt );
|
||||
|
||||
if ( $this->ipsclass->vars['allow_images'] )
|
||||
{
|
||||
$txt = preg_replace( "#\[img\](.+?)\[/img\]#ie", "\$this->bbclass->regex_check_image('\\1')", $txt );
|
||||
$txt = preg_replace_callback( "#\[img\](.+?)\[/img\]#i", array( $this->bbclass, 'regex_check_image' ), $txt );
|
||||
}
|
||||
|
||||
return $txt;
|
||||
@@ -369,7 +373,7 @@ class parse_bbcode
|
||||
// Check emoticons
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! is_array( $this->ipsclass->cache['emoticons'] ) )
|
||||
if ( !isset($this->ipsclass->cache['emoticons']) OR !is_array( $this->ipsclass->cache['emoticons'] ) )
|
||||
{
|
||||
$this->ipsclass->cache['emoticons'] = array();
|
||||
|
||||
@@ -380,6 +384,8 @@ class parse_bbcode
|
||||
{
|
||||
$this->ipsclass->cache['emoticons'][] = $r;
|
||||
}
|
||||
|
||||
@usort( $this->ipsclass->cache['emoticons'] , array( 'class_bbcode_core', 'smilie_length_sort' ) );
|
||||
|
||||
if ( $this->allow_update_caches )
|
||||
{
|
||||
@@ -391,11 +397,11 @@ class parse_bbcode
|
||||
// Check BBCode
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! is_array( $this->ipsclass->cache['bbcode'] ) )
|
||||
if ( !isset($this->ipsclass->cache['bbcode']) OR !is_array( $this->ipsclass->cache['bbcode'] ) )
|
||||
{
|
||||
$this->ipsclass->cache['bbcode'] = array();
|
||||
|
||||
$this->ipsclass->DB->simple_construct( array( 'select' => 'bbcode_id, bbcode_tag, bbcode_replace, bbcode_useoption', 'from' => 'custom_bbcode' ) );
|
||||
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'custom_bbcode' ) );
|
||||
$bbcode = $this->ipsclass->DB->simple_exec();
|
||||
|
||||
while ( $r = $this->ipsclass->DB->fetch_row($bbcode) )
|
||||
@@ -413,7 +419,7 @@ class parse_bbcode
|
||||
// Check badwords
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! is_array( $this->ipsclass->cache['badwords'] ) )
|
||||
if ( !isset($this->ipsclass->cache['badwords']) OR !is_array( $this->ipsclass->cache['badwords'] ) )
|
||||
{
|
||||
$this->ipsclass->cache['badwords'] = array();
|
||||
|
||||
@@ -425,6 +431,11 @@ class parse_bbcode
|
||||
$this->ipsclass->cache['badwords'][] = $r;
|
||||
}
|
||||
|
||||
if( count($this->ipsclass->cache['badwords']) )
|
||||
{
|
||||
@usort( $this->ipsclass->cache['badwords'] , array( 'class_bbcode_core', 'word_length_sort' ) );
|
||||
}
|
||||
|
||||
if ( $this->allow_update_caches )
|
||||
{
|
||||
$this->ipsclass->update_cache( array( 'name' => 'badwords', 'array' => 1, 'deletefirst' => 1 ) );
|
||||
|
||||
Reference in new issue
Block a user