Version 3.1.4

This commit is contained in:
Neo committed 2025-12-19 00:32:22 -08:00
1 parent 1d4720f3e2
commit ae5c01cc78
2563 files changed
+283048 -240689

No files matched your search

@@ -1,18 +1,19 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.0.5
* IP.Board v3.1.4
* BBCode parsing gateway.
* Last Updated: $Date: 2009-11-11 20:48:24 -0500 (Wed, 11 Nov 2009) $
* Last Updated: $Date: 2010-11-12 13:07:33 -0500 (Fri, 12 Nov 2010) $
* </pre>
*
* @author $Author: bfarber $
* @author $Author: ips_terabyte $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @link http://www.iinvisionpower.com
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @link http://www.invisionpower.com
* @since 9th March 2005 11:03
* @version $Revision: 5376 $
*
* @version $Revision: 7174 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -23,10 +24,24 @@ if ( ! defined( 'IN_IPB' ) )
class parseBbcode
{
/**
* Registry Object Shortcuts
*
* @var object
*/
protected $registry;
protected $DB;
protected $settings;
protected $request;
protected $lang;
protected $member;
protected $memberData;
protected $cache;
protected $caches;
/**
* Allowed to update the caches if not present
*
* @access public
* @var boolean
*/
public $allow_update_caches = true;
@@ -34,7 +49,6 @@ class parseBbcode
/**
* Parse emoticons?
*
* @access public
* @var boolean
*/
public $parse_smilies = true;
@@ -43,7 +57,6 @@ class parseBbcode
* Parse HTML?
* HIGHLY NOT RECOMMENDED IN MOST CASES
*
* @access public
* @var boolean
*/
public $parse_html = false;
@@ -51,7 +64,6 @@ class parseBbcode
/**
* Parse bbcode?
*
* @access public
* @var boolean
*/
public $parse_bbcode = true;
@@ -60,7 +72,6 @@ class parseBbcode
* Strip quotes?
* Strips quotes from the resulting text
*
* @access public
* @var boolean
*/
public $strip_quotes = false;
@@ -68,7 +79,6 @@ class parseBbcode
/**
* Auto convert newlines to html line breaks
*
* @access public
* @var boolean
*/
public $parse_nl2br = true;
@@ -76,7 +86,6 @@ class parseBbcode
/**
* Parse wordwrap
*
* @access public
* @var boolean
*/
public $parse_wordwrap = 0;
@@ -84,7 +93,6 @@ class parseBbcode
/**
* Bypass badwords?
*
* @access public
* @var boolean
*/
public $bypass_badwords = false;
@@ -92,7 +100,6 @@ class parseBbcode
/**
* Section keyword for parsing area
*
* @access public
* @var string
*/
public $parsing_section = 'post';
@@ -100,7 +107,6 @@ class parseBbcode
/**
* Group id of poster
*
* @access public
* @var int
*/
public $parsing_mgroup = 0;
@@ -108,7 +114,6 @@ class parseBbcode
/**
* Value of mgroup_others for poster
*
* @access public
* @var string
*/
public $parsing_mgroup_others = '';
@@ -116,7 +121,6 @@ class parseBbcode
/**
* Error code stored
*
* @access public
* @var string
*/
public $error = '';
@@ -124,7 +128,6 @@ class parseBbcode
/**
* Warning code stored
*
* @access public
* @var string
*/
public $warning = '';
@@ -132,7 +135,6 @@ class parseBbcode
/**
* BBCode library object
*
* @access protected
* @var object
*/
protected $bbclass;
@@ -140,71 +142,13 @@ class parseBbcode
/**
* Already loaded the classes?
*
* @access protected
* @var boolean
*/
protected $classes_loaded = false;
/**
* Registry object
*
* @access protected
* @var object
*/
protected $registry;
/**
* Database object
*
* @access protected
* @var object
*/
protected $DB;
/**
* Settings object
*
* @access protected
* @var object
*/
protected $settings;
/**
* Request object
*
* @access protected
* @var object
*/
protected $request;
/**
* Language object
*
* @access protected
* @var object
*/
protected $lang;
/**
* Member object
*
* @access protected
* @var object
*/
protected $member;
/**
* Cache object
*
* @access protected
* @var object
*/
protected $cache;
/**
* Constructor
*
* @access public
* @param object Registry object
* @param string Parsing method to use
* @return void
@@ -236,8 +180,9 @@ class parseBbcode
/**
* Load the required bbcode classes and initialize the object
*
* @access private
* @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
*/
private function _loadClasses()
{
@@ -247,7 +192,7 @@ class parseBbcode
{
$_NOW = IPSDebug::getMemoryDebugFlag();
require_once( IPS_ROOT_PATH . 'sources/classes/bbcode/core.php' );
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/bbcode/core.php', 'class_bbcode_core' );
IPSDebug::setMemoryDebugFlag( "Require once call for core.php", $_NOW );
@@ -259,7 +204,7 @@ class parseBbcode
break;
default:
$file = '';//'normal.php';
$class = 'class_bbcode_core';
$class = $classToLoad;
break;
}
@@ -280,7 +225,6 @@ class parseBbcode
/**
* Pass off our settings to our bbcode handler
*
* @access private
* @return void
*/
private function _passSettings()
@@ -308,7 +252,6 @@ class parseBbcode
* Parses the bbcode to be stored into the database.
* If all bbcodes are parse on display, this method does nothing really
*
* @access public
* @param string Raw input text to parse
* @return string Parsed text ready to be stored in database
*/
@@ -327,7 +270,6 @@ class parseBbcode
* Parses the bbcode to be shown in the STD editor.
* If all bbcodes are parse on display, this method does nothing really
*
* @access public
* @param string Raw input text to parse
* @return string Parsed text ready to be stored in database
*/
@@ -346,7 +288,6 @@ class parseBbcode
* Parses the bbcode to be shown in the browser. Expects preDbParse has already been done before the save.
* If all bbcodes are parse on save, this method does nothing really
*
* @access public
* @param string Raw input text to parse
* @return string Parsed text ready to be displayed
*/
@@ -371,7 +312,6 @@ class parseBbcode
* Parses the bbcode to be shown in the polls.
* Parses img and url, if enabled
*
* @access public
* @param string Raw input text to parse
* @return string Parsed text ready to be displayed
*/
@@ -390,7 +330,6 @@ class parseBbcode
* Converts the STD contents to RTE compatible output
* Used when switching editors or taking the bbcode post and putting into the RTE
*
* @access public
* @param string BBCode text
* @return string RTE-compatible text
*/
@@ -434,7 +373,6 @@ class parseBbcode
/**
* Converts "IP.Board HTML" to regular (RTE) HTML
*
* @access public
* @param string Parsed text
* @return string RTE-compatible text
*/
@@ -448,7 +386,6 @@ class parseBbcode
/**
* Strip all HTML and bbcode tags
*
* @access public
* @param string BBCode + HTML text
* @param boolean Run through pre_edit_parse
* @param boolean Check "strip from search" option
@@ -464,7 +401,6 @@ class parseBbcode
/**
* Strip quotes
*
* @access public
* @param string Raw posted text
* @return string Raw text with no quotes
*/
@@ -478,7 +414,6 @@ class parseBbcode
/**
* Strip emoticons
*
* @access public
* @param string Raw posted text
* @return string Raw text with no emoticons
*/
@@ -492,7 +427,6 @@ class parseBbcode
/**
* Unconvert emoticons
*
* @access public
* @param string Raw posted text
* @return string Raw text with text emoticons
*/
@@ -506,7 +440,6 @@ class parseBbcode
/**
* Strip badwords
*
* @access public
* @param string Raw posted text
* @return string Raw text with no badwords
*/
@@ -517,10 +450,22 @@ class parseBbcode
return $this->bbclass->badWords( $t );
}
/**
* Check against blacklisted URLs
*
* @param string Raw posted text
* @return bool False if blacklisted url present, otherwise true
*/
public function checkBlacklistUrls( $t )
{
$this->_passSettings();
return $this->bbclass->checkBlacklistUrls( $t );
}
/**
* Apply word wrapping
*
* @access public
* @param string BBCode + HTML text
* @param integer Number of characters to wrap after
* @param string Break string
@@ -537,7 +482,6 @@ class parseBbcode
/**
* Make data in quotes "safe"
*
* @access public
* @param string Raw posted text
* @return string Raw text safe for use in quote tag
*/
@@ -551,7 +495,6 @@ class parseBbcode
/**
* Clean content from XSS (best shot at least)
*
* @access public
* @param string Raw posted text
* @param boolean Attempt to fix script tag
* @return string Cleaned text
@@ -567,7 +510,6 @@ class parseBbcode
* Determines if member is viewing images
* If not, unparses smilies
*
* @access public
* @param string Raw input text to parse
* @return string Parsed text ready to be stored in database
*/