Version 3.2.3
This commit is contained in:
1 parent
ae5c01cc78
commit
78706903a2
2641 files changed
+228363
-201264
No files matched your search
@@ -2,18 +2,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* BBCode parsing gateway.
|
||||
* Last Updated: $Date: 2010-11-12 13:07:33 -0500 (Fri, 12 Nov 2010) $
|
||||
* Last Updated: $Date: 2011-06-07 18:56:57 -0400 (Tue, 07 Jun 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @license This is NULLED!
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @link http://hatynka.in
|
||||
* @since 9th March 2005 11:03
|
||||
* @version $Revision: 7174 $
|
||||
* @version $Revision: 8999 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -82,13 +82,6 @@ class parseBbcode
|
||||
* @var boolean
|
||||
*/
|
||||
public $parse_nl2br = true;
|
||||
|
||||
/**
|
||||
* Parse wordwrap
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $parse_wordwrap = 0;
|
||||
|
||||
/**
|
||||
* Bypass badwords?
|
||||
@@ -151,7 +144,7 @@ class parseBbcode
|
||||
*
|
||||
* @param object Registry object
|
||||
* @param string Parsing method to use
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry, $method='normal' )
|
||||
{
|
||||
@@ -174,46 +167,27 @@ class parseBbcode
|
||||
/* And some default properties */
|
||||
$this->bypass_badwords = $this->memberData ? intval( $this->memberData['g_bypass_badwords'] ) : 0;
|
||||
$this->strip_quotes = $this->settings['strip_quotes'];
|
||||
$this->parse_wordwrap = $this->settings['post_wordwrap'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the required bbcode classes and initialize the object
|
||||
*
|
||||
* @return void
|
||||
* @todo Needs the new library hook call when implemented
|
||||
* @todo Remove that swith and just check for 'if legacy' => load the other file and change class
|
||||
* @return @e void
|
||||
*/
|
||||
private function _loadClasses()
|
||||
protected function _loadClasses()
|
||||
{
|
||||
$_NOW = IPSDebug::getMemoryDebugFlag();
|
||||
|
||||
if ( ! $this->classes_loaded )
|
||||
{
|
||||
$_NOW = IPSDebug::getMemoryDebugFlag();
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/bbcode/core.php', 'class_bbcode_core' );
|
||||
|
||||
IPSDebug::setMemoryDebugFlag( "Require once call for core.php", $_NOW );
|
||||
|
||||
switch( $this->pre_edit_parse_method )
|
||||
|
||||
if( $this->pre_edit_parse_method == 'legacy' )
|
||||
{
|
||||
case 'legacy':
|
||||
$file = 'legacy.php';
|
||||
$class = 'class_bbcode_legacy';
|
||||
break;
|
||||
default:
|
||||
$file = '';//'normal.php';
|
||||
$class = $classToLoad;
|
||||
break;
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/bbcode/legacy.php', 'class_bbcode_legacy' );
|
||||
}
|
||||
|
||||
if( $file )
|
||||
{
|
||||
require_once ( IPS_ROOT_PATH . 'sources/classes/bbcode/' . $file );
|
||||
}
|
||||
|
||||
$this->bbclass = new $class( $this->registry );
|
||||
$this->bbclass = new $classToLoad( $this->registry );
|
||||
$this->classes_loaded = true;
|
||||
$this->error =& $this->bbclass->error;
|
||||
$this->warning =& $this->bbclass->warning;
|
||||
@@ -225,10 +199,13 @@ class parseBbcode
|
||||
/**
|
||||
* Pass off our settings to our bbcode handler
|
||||
*
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
private function _passSettings()
|
||||
protected function _passSettings()
|
||||
{
|
||||
/* Clean out secondary groups just in case of ,, */
|
||||
$this->parsing_mgroup_others = IPSText::cleanPermString( $this->parsing_mgroup_others );
|
||||
|
||||
//-----------------------------------------
|
||||
// Pass the settings
|
||||
//-----------------------------------------
|
||||
@@ -241,7 +218,6 @@ class parseBbcode
|
||||
$this->bbclass->parse_bbcode = $this->parse_bbcode;
|
||||
$this->bbclass->strip_quotes = $this->strip_quotes;
|
||||
$this->bbclass->parse_nl2br = $this->parse_nl2br;
|
||||
$this->bbclass->parse_wordwrap = $this->parse_wordwrap;
|
||||
$this->bbclass->parsing_section = $this->parsing_section;
|
||||
$this->bbclass->parsing_mgroup = $this->parsing_mgroup;
|
||||
$this->bbclass->parsing_mgroup_others = $this->parsing_mgroup_others;
|
||||
@@ -304,7 +280,7 @@ class parseBbcode
|
||||
$text = $this->bbclass->preDisplayParse( $text );
|
||||
|
||||
IPSDebug::setMemoryDebugFlag( "PreDisplayParse completed", $_NOW );
|
||||
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
@@ -317,11 +293,8 @@ class parseBbcode
|
||||
*/
|
||||
public function parsePollTags( $text )
|
||||
{
|
||||
if( $this->settings['poll_tags'] )
|
||||
{
|
||||
$text = $this->bbclass->parseBbcode( $text, 'display', array( 'img', 'url' ) );
|
||||
$text = $this->bbclass->finishNonParsed( $text, 'display' );
|
||||
}
|
||||
$text = $this->bbclass->parseBbcode( $text, 'display', array( 'img', 'url' ) );
|
||||
$text = $this->bbclass->finishNonParsed( $text, 'display' );
|
||||
|
||||
return $text;
|
||||
}
|
||||
@@ -388,14 +361,13 @@ class parseBbcode
|
||||
*
|
||||
* @param string BBCode + HTML text
|
||||
* @param boolean Run through pre_edit_parse
|
||||
* @param boolean Check "strip from search" option
|
||||
* @return string Raw text with no tags
|
||||
*/
|
||||
public function stripAllTags( $t, $pre_edit_parse=true, $only_search=true )
|
||||
public function stripAllTags( $t, $pre_edit_parse=true )
|
||||
{
|
||||
$this->_passSettings();
|
||||
|
||||
return $this->bbclass->stripAllTags( $t, $pre_edit_parse, $only_search );
|
||||
return $this->bbclass->stripAllTags( $t, $pre_edit_parse );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -411,6 +383,19 @@ class parseBbcode
|
||||
return $this->bbclass->stripBbcode( 'quote', $t );
|
||||
}
|
||||
|
||||
/**
|
||||
* Strip shared media
|
||||
*
|
||||
* @param string Raw posted text
|
||||
* @return string Raw text with no shared media
|
||||
*/
|
||||
public function stripSharedMedia( $t )
|
||||
{
|
||||
$t = preg_replace( "#\[sharedmedia=([^\]]+?)\]#is", " ", $t );
|
||||
|
||||
return $t;
|
||||
}
|
||||
|
||||
/**
|
||||
* Strip emoticons
|
||||
*
|
||||
@@ -432,9 +417,7 @@ class parseBbcode
|
||||
*/
|
||||
public function unconvertSmilies( $t )
|
||||
{
|
||||
$this->_passSettings();
|
||||
|
||||
return $this->bbclass->unconvertSmilies( $t );
|
||||
return IPSText::unconvertSmilies( $t );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -462,22 +445,6 @@ class parseBbcode
|
||||
|
||||
return $this->bbclass->checkBlacklistUrls( $t );
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply word wrapping
|
||||
*
|
||||
* @param string BBCode + HTML text
|
||||
* @param integer Number of characters to wrap after
|
||||
* @param string Break string
|
||||
* @return string Raw text with no tags
|
||||
*/
|
||||
public function wordWrap( $t, $chars=80, $break="\n" )
|
||||
{
|
||||
$this->parse_wordwrap = $chars;
|
||||
$this->_passSettings();
|
||||
|
||||
return $this->bbclass->applyWordwrap( $t, $chars, $break );
|
||||
}
|
||||
|
||||
/**
|
||||
* Make data in quotes "safe"
|
||||
@@ -505,16 +472,4 @@ class parseBbcode
|
||||
|
||||
return $this->bbclass->checkXss( $t, $fixScript );
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if member is viewing images
|
||||
* If not, unparses smilies
|
||||
*
|
||||
* @param string Raw input text to parse
|
||||
* @return string Parsed text ready to be stored in database
|
||||
*/
|
||||
public function memberViewImages( $text )
|
||||
{
|
||||
return IPSLib::memberViewImages( $text );
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user