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' );
|
||||
|
||||
|
||||
Reference in new issue
Block a user