Version 3.4.6
This commit is contained in:
1 parent
e4478369d8
commit
b45ea0dffb
1568 files changed
+155104
-161665
No files matched your search
@@ -3,7 +3,7 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* IP.Board v3.4.6
|
||||
* BBCode parsing core - common methods
|
||||
* Last Updated: $Date: 2012-06-08 09:28:02 +0100 (Fri, 08 Jun 2012) $
|
||||
* </pre>
|
||||
@@ -420,8 +420,14 @@ class class_text_parser_bbcode extends classes_text_parser
|
||||
$txt = str_replace( '</div><br />', '</div>', $txt );
|
||||
$txt = str_replace( '</blockquote><br />', '</blockquote>', $txt );
|
||||
|
||||
// Don't auto-link media.
|
||||
parent::$NoMediaAutoLinkify = true;
|
||||
|
||||
$txt = $this->_autoLinkUrls( $txt );
|
||||
|
||||
// Reset
|
||||
parent::$NoMediaAutoLinkify = false;
|
||||
|
||||
return $txt;
|
||||
}
|
||||
|
||||
@@ -1289,7 +1295,7 @@ class class_text_parser_bbcode extends classes_text_parser
|
||||
$txt = $this->_autoLinkUrls( $txt );
|
||||
}
|
||||
|
||||
preg_match_all( '#<a\s+?(?:[^>]*?)href=["\']([^"\']+?)?["\']([^>]*?)?>(.+?)</a>#isu', $txt, $urlMatches );
|
||||
preg_match_all( '#<a\s+?(?:[^>]*?)href=["\']([^"\']+?)?["\']([^>]*?)?>(.+?)</a>#is', $txt, $urlMatches );
|
||||
|
||||
/* Finish up URLs and such */
|
||||
for( $i = 0 ; $i < count( $urlMatches[0] ) ; $i++ )
|
||||
@@ -1381,8 +1387,7 @@ class class_text_parser_bbcode extends classes_text_parser
|
||||
*/
|
||||
if ( ( empty( $this->settings['__noTruncateUrl'] ) ) and IPSText::mbstrlen( $text ) > 38 && ( ! preg_match( '#&\#([0-9]{2,4})#i', $text ) ) and ( substr( $text, 0, 7 ) == 'http://' or substr( $text, 0, 8 ) == 'https://' ) )
|
||||
{
|
||||
$text = htmlspecialchars( IPSText::mbsubstr( $this->utf8_urldecode( $text ) , 0, 20 ) ) . '...' . htmlspecialchars( IPSText::mbsubstr($this->utf8_urldecode( $text ) , -15 ) );
|
||||
//$text = htmlspecialchars( IPSText::mbsubstr( html_entity_decode( urldecode( $text ) ), 0, 20 ) ) . '...' . htmlspecialchars( IPSText::mbsubstr( html_entity_decode( urldecode( $text ) ), - 15 ) );
|
||||
$text = htmlspecialchars( IPSText::mbsubstr( html_entity_decode( urldecode( $text ) ), 0, 20 ) ) . '...' . htmlspecialchars( IPSText::mbsubstr( html_entity_decode( urldecode( $text ) ), - 15 ) );
|
||||
}
|
||||
|
||||
// -----------------------------------------
|
||||
@@ -1432,14 +1437,6 @@ class class_text_parser_bbcode extends classes_text_parser
|
||||
}
|
||||
|
||||
return $txt;
|
||||
|
||||
|
||||
}
|
||||
function utf8_urldecode($str)
|
||||
{
|
||||
$str = preg_replace("/%u([0-9a-f]{3,4})/i","&#x\\1;",urldecode($str));
|
||||
$str = mb_convert_encoding($str, IPS_DOC_CHAR_SET);
|
||||
return html_entity_decode($str,null,IPS_DOC_CHAR_SET);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1559,6 +1556,11 @@ class class_text_parser_bbcode extends classes_text_parser
|
||||
{
|
||||
return $matches[0];
|
||||
}
|
||||
|
||||
if ( $matches[1] == ']' )
|
||||
{
|
||||
return $matches[0];
|
||||
}
|
||||
|
||||
if ( isset( $matches[4] ) AND stristr( $matches[4], '</a>' ) )
|
||||
{
|
||||
@@ -1591,7 +1593,7 @@ class class_text_parser_bbcode extends classes_text_parser
|
||||
}
|
||||
|
||||
/* Is this a media URL? */
|
||||
if( $this->settings['bbcode_automatic_media'] and isset( $this->_bbcodes['media'] ) and ( $this->_bbcodes['media']['bbcode_sections'] == 'all' or in_array( parent::$Perms['parseArea'], explode( ',', $this->_bbcodes['media']['bbcode_sections'] ) ) ) )
|
||||
if( ! parent::$NoMediaAutoLinkify and $this->settings['bbcode_automatic_media'] and isset( $this->_bbcodes['media'] ) and ( $this->_bbcodes['media']['bbcode_sections'] == 'all' or in_array( parent::$Perms['parseArea'], explode( ',', $this->_bbcodes['media']['bbcode_sections'] ) ) ) )
|
||||
{
|
||||
$media = $this->cache->getCache( 'mediatag' );
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* IP.Board v3.4.6
|
||||
* IP.Content custom bbcode
|
||||
* Last Updated: $Date: 2012-06-01 13:11:08 -0400 (Fri, 01 Jun 2012) $
|
||||
* </pre>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* IP.Board v3.4.6
|
||||
* Custom bbcode plugin interfaces
|
||||
* Last Updated: $Date: 2012-05-24 16:33:36 +0100 (Thu, 24 May 2012) $
|
||||
* </pre>
|
||||
@@ -12,13 +12,13 @@
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10790 $
|
||||
* @version $Rev: 10790 $
|
||||
*/
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* IP.Board v3.4.6
|
||||
* BBCode parser: default custom bbcodes: img, quote, list, size, member, media, url, snapback
|
||||
* Last Updated: $Date: 2012-05-24 16:33:36 +0100 (Thu, 24 May 2012) $
|
||||
* </pre>
|
||||
@@ -28,7 +28,7 @@
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10790 $
|
||||
* @version $Rev: 10790 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -39,7 +39,7 @@ class bbcode_parent_main_class
|
||||
*
|
||||
* @access protected
|
||||
* @var integer
|
||||
*/
|
||||
*/
|
||||
protected $cur_pos = 0;
|
||||
|
||||
/**
|
||||
@@ -47,7 +47,7 @@ class bbcode_parent_main_class
|
||||
*
|
||||
* @access protected
|
||||
* @var integer
|
||||
*/
|
||||
*/
|
||||
protected $end_pos = 0;
|
||||
|
||||
/**
|
||||
@@ -55,7 +55,7 @@ class bbcode_parent_main_class
|
||||
*
|
||||
* @access public
|
||||
* @var string
|
||||
*/
|
||||
*/
|
||||
public $error = '';
|
||||
|
||||
/**
|
||||
@@ -63,7 +63,7 @@ class bbcode_parent_main_class
|
||||
*
|
||||
* @access public
|
||||
* @var string
|
||||
*/
|
||||
*/
|
||||
public $warning = '';
|
||||
|
||||
/**
|
||||
@@ -71,7 +71,7 @@ class bbcode_parent_main_class
|
||||
*
|
||||
* @access protected
|
||||
* @var integer
|
||||
*/
|
||||
*/
|
||||
protected $_bbcode = array();
|
||||
|
||||
/**
|
||||
@@ -79,7 +79,7 @@ class bbcode_parent_main_class
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
*/
|
||||
protected $registry;
|
||||
|
||||
/**
|
||||
@@ -87,7 +87,7 @@ class bbcode_parent_main_class
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
*/
|
||||
protected $DB;
|
||||
|
||||
/**
|
||||
@@ -95,7 +95,7 @@ class bbcode_parent_main_class
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
*/
|
||||
protected $settings;
|
||||
|
||||
/**
|
||||
@@ -103,7 +103,7 @@ class bbcode_parent_main_class
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
*/
|
||||
protected $request;
|
||||
|
||||
/**
|
||||
@@ -111,7 +111,7 @@ class bbcode_parent_main_class
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
*/
|
||||
protected $lang;
|
||||
|
||||
/**
|
||||
@@ -119,7 +119,7 @@ class bbcode_parent_main_class
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
*/
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
|
||||
@@ -128,7 +128,7 @@ class bbcode_parent_main_class
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
*/
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
|
||||
@@ -283,7 +283,7 @@ class bbcode_plugin_sharedmedia extends bbcode_parent_main_class
|
||||
$app = trim( $matches[2] );
|
||||
$plugin = trim( $matches[3] );
|
||||
|
||||
if( !$txt OR !$app OR !$plugin )
|
||||
if( !$txt OR !$app OR ! IPSLib::appIsInstalled( $app ) OR !$plugin )
|
||||
{
|
||||
return '';
|
||||
}
|
||||
@@ -326,7 +326,7 @@ class bbcode_plugin_sharedmedia extends bbcode_parent_main_class
|
||||
$plugin = trim( $matches[3] );
|
||||
$_orig = $txt;
|
||||
|
||||
if( !$txt OR !$app OR !$plugin )
|
||||
if( !$txt OR !$app OR ! IPSLib::appIsInstalled( $app ) OR !$plugin )
|
||||
{
|
||||
return '';
|
||||
}
|
||||
@@ -933,7 +933,7 @@ class bbcode_plugin_size extends bbcode_parent_main_class
|
||||
*
|
||||
* @access protected
|
||||
* @var array
|
||||
*/
|
||||
*/
|
||||
protected $font_sizes = array( 1 => 8,
|
||||
2 => 10,
|
||||
3 => 12,
|
||||
@@ -1259,7 +1259,7 @@ class bbcode_plugin_url extends bbcode_parent_main_class
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Need this because HTML on converts the
|
||||
// Need this because HTML on converts the
|
||||
// entities back to quote/apos
|
||||
//-----------------------------------------
|
||||
|
||||
@@ -1278,7 +1278,7 @@ class bbcode_plugin_url extends bbcode_parent_main_class
|
||||
$txt = substr_replace( $txt, $new_content, $this->cur_pos + $open_length + 1, ($end_pos - ($this->cur_pos + $open_length + 1 ) ) );
|
||||
}
|
||||
else if( substr( $txt, $this->cur_pos + $open_length, 1 ) == "'" )
|
||||
{
|
||||
{
|
||||
/* Skip the bbocde if there is mroe than 2 quotes. Bug #21161 */
|
||||
if( strlen( substr( $txt, $this->cur_pos, stripos( $txt, ']', $this->cur_pos ) - $this->cur_pos ) ) < 1 OR ( substr_count( $txt, "'", $this->cur_pos, strlen( substr( $txt, $this->cur_pos, stripos( $txt, ']', $this->cur_pos ) - $this->cur_pos ) ) ) ) > 2 )
|
||||
{
|
||||
@@ -1350,7 +1350,7 @@ class bbcode_plugin_url extends bbcode_parent_main_class
|
||||
|
||||
//-----------------------------------------
|
||||
// If this is a single tag, that's it
|
||||
// @link: http://forums.invisionpower.com/index.php?autocom=tracker&showissue=11909
|
||||
// @link: http://forums.invisionpower.com/index.php?autocom=tracker&showissue=11909
|
||||
//-----------------------------------------
|
||||
|
||||
if( $_content OR $_content === '0' )
|
||||
@@ -1414,7 +1414,7 @@ class bbcode_plugin_url extends bbcode_parent_main_class
|
||||
else if( substr( $option, 0, 1 ) == "'" )
|
||||
{
|
||||
$option = substr( $option, 1 );
|
||||
}
|
||||
}
|
||||
else if( substr( $option, 0, 1 ) == '"' )
|
||||
{
|
||||
$option = substr( $option, 1 );
|
||||
@@ -1431,7 +1431,7 @@ class bbcode_plugin_url extends bbcode_parent_main_class
|
||||
else if( substr( $option, -1 ) == "'" )
|
||||
{
|
||||
$option = substr( $option, 0, -1 );
|
||||
}
|
||||
}
|
||||
else if( substr( $option, -1 ) == '"' )
|
||||
{
|
||||
$option = substr( $option, 0, -1 );
|
||||
@@ -1484,7 +1484,7 @@ class bbcode_plugin_url extends bbcode_parent_main_class
|
||||
{
|
||||
$this->warning = 'domain_not_allowed';
|
||||
return $option;
|
||||
}
|
||||
}
|
||||
|
||||
/* If this is just converting to HTML and not display, return the URL as
|
||||
* filters and such are tested on display */
|
||||
@@ -1847,6 +1847,7 @@ class bbcode_plugin_code extends bbcode_parent_main_class
|
||||
$content = trim( $content );
|
||||
|
||||
$content = preg_replace( '#(<br(?:[^>]+?)?>)#i', '', $content );
|
||||
|
||||
$content = trim( $content );
|
||||
|
||||
$content = str_replace( '<!-preserve.newline-->', "\n", $content );
|
||||
@@ -2632,6 +2633,9 @@ class bbcode_plugin_member extends bbcode_parent_main_class
|
||||
/* Re-encode single quote: @link http://community.invisionpower.com/resources/bugs.html/_/ip-board/apostrophes-and-member-bbcode-r41425 */
|
||||
$_option = str_replace( "'", ''', $_option );
|
||||
|
||||
/* Re-encode exclamation points: @link http://community.invisionpower.com/resources/bugs.html/_/ip-board/username-is-now-showing-with-member-tag-if-contains-r43032 */
|
||||
$_option = str_replace( "!", '!', $_option );
|
||||
|
||||
$existing = $this->cache->getCache( '_tmp_bbcode_members', false );
|
||||
$existing = is_array($existing) ? $existing : array();
|
||||
|
||||
@@ -2645,6 +2649,10 @@ class bbcode_plugin_member extends bbcode_parent_main_class
|
||||
{
|
||||
$_content = $this->_buildOutput( $existing[ $_option ] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$_content = $_option;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// If this is a single tag, that's it
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* IP.Board v3.4.6
|
||||
* Text Parsing: HTML
|
||||
* Last Updated: $Date: 2012-06-08 09:28:02 +0100 (Fri, 08 Jun 2012) $
|
||||
* </pre>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* IP.Board v3.4.6
|
||||
* Text Parsing: LEGACY CR..STUFF
|
||||
* Last Updated: $Date: 2012-06-08 09:28:02 +0100 (Fri, 08 Jun 2012) $
|
||||
* </pre>
|
||||
|
||||
Reference in new issue
Block a user