Version 3.4.8
This commit is contained in:
1 parent
b45ea0dffb
commit
c603205a25
1398 files changed
+36675
-31023
No files matched your search
@@ -3,18 +3,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.6
|
||||
* IP.Board v3.4.8
|
||||
* Editor Library: RTE (WYSIWYG) Class
|
||||
* Last Updated: $Date: 2013-10-15 10:08:51 -0400 (Tue, 15 Oct 2013) $
|
||||
* Last Updated: $Date: 2014-10-13 15:22:47 -0400 (Mon, 13 Oct 2014) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: AndyMillne $
|
||||
* @author $Author: rashbrook $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 9th March 2005 11:03
|
||||
* @version $Revision: 12378 $
|
||||
* @version $Revision: 12540 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -380,6 +380,24 @@ class classes_editor_composite
|
||||
|
||||
/* Make {style_images_url} safe */
|
||||
$content = str_replace( '{style_images_url}', '{style_images_url}', $content );
|
||||
|
||||
/* Make remote images safe in ACP */
|
||||
if( IN_ACP )
|
||||
{
|
||||
preg_match_all( "/\<img.+?src=['\"](.+?)[\"'].+?>/ims", $content, $matches );
|
||||
|
||||
$ourHost = parse_url( $this->settings['base_url'], PHP_URL_HOST );
|
||||
|
||||
foreach( $matches[1] as $index => $url )
|
||||
{
|
||||
$host = parse_url( $url, PHP_URL_HOST );
|
||||
|
||||
if( $host != $ourHost )
|
||||
{
|
||||
$content = str_replace( $matches[0][ $index ], "[img]" . $url . "[/img]", $content );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->content = $content;
|
||||
}
|
||||
@@ -445,7 +463,7 @@ class classes_editor_composite
|
||||
{
|
||||
$options['isRte'] = intval( $this->request['isRte'] );
|
||||
}
|
||||
|
||||
|
||||
$_autoSaveKeyOrig = ( ! empty( $options['autoSaveKey'] ) ) ? $options['autoSaveKey'] : '';
|
||||
$options['editorName'] = ( ! empty( $options['editorName'] ) ) ? $options['editorName'] : $this->_fetchEditorName();
|
||||
$options['autoSaveKey'] = ( $_autoSaveKeyOrig && $this->memberData['member_id'] ) ? $this->_generateAutoSaveKey( $_autoSaveKeyOrig ) : '';
|
||||
@@ -1181,17 +1199,17 @@ class classes_editor_composite
|
||||
$content = preg_replace( '#<img src="<a href="([^"]+?)(?:%5D)?"([^>]+?)?>([^"]+?)"#i', '<img src="\1"', $content );
|
||||
|
||||
/* @link http://community.invisionpower.com/resources/bugs.html/_/ip-board/img-tag-no-http-r40534 */
|
||||
preg_match_all( '#<img src=[\'"]([^\'"]+?)[\'"]([^>]+?)?>#i', $content, $matches, PREG_SET_ORDER );
|
||||
preg_match_all( '#<img src=([\'"])([^\1]+?)(?:\1)([^>]+?)?>#i', $content, $matches, PREG_SET_ORDER );
|
||||
|
||||
foreach( $matches as $val )
|
||||
{
|
||||
$all = $val[0];
|
||||
$src = $val[1];
|
||||
$rest = $val[2];
|
||||
|
||||
$src = $val[2];
|
||||
$rest = $val[3];
|
||||
|
||||
if ( substr( $src, 0, 4 ) != 'http' )
|
||||
{
|
||||
$content = str_replace( $all, '<img src="http://' . $src . '"' . $rest . '>', $content );
|
||||
$content = str_replace( $all, '<img src="http://' . str_replace( "'", '%27', $src ) . '"' . $rest . '>', $content );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1206,8 +1224,8 @@ class classes_editor_composite
|
||||
{
|
||||
$content = $this->_stripNonAllowedClasses( $content, 'pre' , array( '_prettyXprint', '_linenums*', '_lang*' ) );
|
||||
$content = $this->_stripNonAllowedClasses( $content, 'blockquote', array( 'ipsBlockquote' ) );
|
||||
$content = $this->_stripNonAllowedClasses( $content, 'ol' , array( 'bbc', 'bbcol', 'decimal' ) );
|
||||
$content = $this->_stripNonAllowedClasses( $content, 'ul' , array( 'bbc', 'bbcol', 'decimal' ) );
|
||||
$content = $this->_stripNonAllowedClasses( $content, 'ol' , array( 'bbc', 'bbcol', 'decimal', 'lower-alpha', 'upper-alpha', 'lower-roman', 'upper-roman' ) );
|
||||
$content = $this->_stripNonAllowedClasses( $content, 'ul' , array( 'bbc', 'bbcol', 'decimal', 'lower-alpha', 'upper-alpha', 'lower-roman', 'upper-roman' ) );
|
||||
$content = $this->_stripNonAllowedClasses( $content, 'a' , array( 'bbc*' ) );
|
||||
$content = $this->_stripNonAllowedClasses( $content, 'p' , array( 'bbc*' ) );
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user