Version 2.2.0 RC-1
This commit is contained in:
1 parent
f73f8bff6d
commit
22f1b963ee
1034 files changed
+178610
-70897
No files matched your search
@@ -2,28 +2,18 @@
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board 2.1.7
|
||||
| Invision Power Board
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2005 Invision Power Services, Inc.
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Tuesday 18th of July 2006 05:56:00 PM
|
||||
| Release: 52f408a29988b02f45b5e6f4ba5af0ae
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
||||
+---------------------------------------------------------------------------
|
||||
| > $Date: 2006-01-30 18:53:19 +0000 (Mon, 30 Jan 2006) $
|
||||
| > $Revision: 127 $
|
||||
| > $Author: bfarber $
|
||||
| > $Date: 2006-10-04 11:22:28 +0100 (Wed, 04 Oct 2006) $
|
||||
| > $Revision: 605 $
|
||||
| > $Author: matt $
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > Posting RTE Editor
|
||||
@@ -60,6 +50,13 @@
|
||||
* @version 2.1
|
||||
* @since 2.1.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
|
||||
exit();
|
||||
}
|
||||
|
||||
class class_editor_module extends class_editor
|
||||
{
|
||||
/**
|
||||
@@ -248,13 +245,22 @@ class class_editor_module extends class_editor
|
||||
// Make URLs safe (prevent tag stripping)
|
||||
//-----------------------------------------
|
||||
|
||||
$t = preg_replace( '#<(a href|img src)=([\'"])([^>]+?)(\\3)#ise', "\$this->unhtml_url( '\\1', '\\3' )", $t );
|
||||
$t = preg_replace_callback( '#<(a href|img src)=([\'"])([^>]+?)(\\3)#is', array( $this, 'unhtml_url' ), $t );
|
||||
|
||||
//-----------------------------------------
|
||||
// Make EMOids safe (prevent tag stripping)
|
||||
//-----------------------------------------
|
||||
|
||||
$t = preg_replace( '#(emoid=\")(.+?)(\")#ise', "'emoid=\"'.\$this->unhtml_emoid('\\2').'\"';", $t );
|
||||
$t = preg_replace_callback( '#(emoid=\")(.+?)(\")#is', array( $this, 'unhtml_emoid' ), $t );
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// WYSI-Weirdness #0: BR tags to \n
|
||||
//-----------------------------------------
|
||||
|
||||
$t = preg_replace( "#<br.*>#isU", "\n", $t );
|
||||
|
||||
$t = trim( $t );
|
||||
|
||||
//-----------------------------------------
|
||||
// Remove tags we're not bothering with
|
||||
@@ -263,15 +269,9 @@ class class_editor_module extends class_editor
|
||||
|
||||
if ( ! $this->allow_html )
|
||||
{
|
||||
$t = strip_tags( $t, '<h1><h2><h3><h4><h5><h6><font><span><div><br><p><img><a><li><ol><ul><b><strong><em><i><u><strike><blockquote>' );
|
||||
$t = strip_tags( $t, '<h1><h2><h3><h4><h5><h6><font><span><div><br><p><img><a><li><ol><ul><b><strong><em><i><u><strike><blockquote><sub><sup>' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// WYSI-Weirdness #0: BR tags to \n
|
||||
//-----------------------------------------
|
||||
|
||||
$t = preg_replace( "#<br.*>#isU", "\n", $t );
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// WYSI-Weirdness #1: Named anchors
|
||||
//-----------------------------------------
|
||||
@@ -310,7 +310,7 @@ class class_editor_module extends class_editor
|
||||
$t = str_replace( "<#EMO_DIR#>", "<#EMO_DIR>", $t );
|
||||
|
||||
# Parse...
|
||||
$t = preg_replace( "#[ ]?<([^>]+?)emoid=\"(.+?)\"([^>]+?)?".">[ ]?#ise", "' '.\$this->html_emoid('\\2').' '", $t );
|
||||
$t = preg_replace_callback( "#[ ]?<([^>]+?)emoid=\"(.+?)\"([^>]+?)?".">[ ]?#is", array( $this, 'html_emoid' ), $t );
|
||||
|
||||
# And convert it back again...
|
||||
$t = str_replace( "<#EMO_DIR>", "<#EMO_DIR#>", $t );
|
||||
@@ -330,7 +330,7 @@ class class_editor_module extends class_editor
|
||||
//-----------------------------------------
|
||||
|
||||
$t = preg_replace( "#\[url=(\"|'|")<a\s+?href=[\"'](.*)/??['\"]\\2/??</a>#is", "[url=\\1\\2", $t );
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Now, recursively parse the other tags
|
||||
// to make sure we get the nested ones
|
||||
@@ -344,6 +344,9 @@ class class_editor_module extends class_editor
|
||||
$t = $this->_recurse_and_parse( 'strike' , $t, "_parse_simple_tag", 's' );
|
||||
$t = $this->_recurse_and_parse( 'blockquote' , $t, "_parse_simple_tag", 'indent' );
|
||||
|
||||
$t = $this->_recurse_and_parse( 'sup' , $t, "_parse_simple_tag", 'sup' );
|
||||
$t = $this->_recurse_and_parse( 'sub' , $t, "_parse_simple_tag", 'sub' );
|
||||
|
||||
//-----------------------------------------
|
||||
// More complex tags
|
||||
//-----------------------------------------
|
||||
@@ -397,6 +400,19 @@ class class_editor_module extends class_editor
|
||||
$t = preg_replace( "#\[(url|img|b|u|i|s|email|list|indent|right|left|center)\]\[/\\1\]#is", "", $t );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// WYSI-Weirdness #11: Opera crap
|
||||
//-----------------------------------------
|
||||
|
||||
$t = preg_replace( "#\[(font|size|color)\]=[\"']([^\"']+?)[\"']\]\[/\\1\]#is", "", $t );
|
||||
|
||||
//-----------------------------------------
|
||||
// WYSI-Weirdness #11: No domain in FF?
|
||||
//-----------------------------------------
|
||||
|
||||
$t = preg_replace( "#(http|https):\/\/index.php(.*?)#is", $this->ipsclass->vars['board_url'].'/index.php\\2', $t );
|
||||
$t = preg_replace( "#\[url=['\"]index.php(.*?)[\"']#is", "[url=\"".$this->ipsclass->vars['board_url'].'/index.php\\1"', $t );
|
||||
|
||||
//-----------------------------------------
|
||||
// Now call the santize routine to make
|
||||
// html and nasties safe. VITAL!!
|
||||
@@ -700,7 +716,7 @@ class class_editor_module extends class_editor
|
||||
// Convert RGB to hex
|
||||
//-----------------------------------------
|
||||
|
||||
$style = preg_replace( '#(?<!\w)color:\s+?rgb\((\d+,\s+?\d+,\s+?\d+)\)(;?)#ie', "'color: '.\$this->_rgb_to_hex( '\\1','\\2' );", $style );
|
||||
$style = preg_replace_callback( '#(?<!\w)color:\s+?rgb\((\d+,\s+?\d+,\s+?\d+)\)(;?)#i', array( $this, '_rgb_to_hex' ), $style );
|
||||
|
||||
//-----------------------------------------
|
||||
// Pick through possible styles
|
||||
@@ -1213,9 +1229,18 @@ class class_editor_module extends class_editor
|
||||
*/
|
||||
function _get_value_of_option( $option, $text )
|
||||
{
|
||||
preg_match( "#$option(\s+?)?\=(\s+?)?[\"']?(.+?)([\"']|(\s+?)|$|>)#is", $text, $matches );
|
||||
if( $option == 'face' )
|
||||
{
|
||||
// Bad font face, bad
|
||||
preg_match( "#$option(\s+?)?\=(\s+?)?[\"']?(.+?)([\"']|$|color|size|>)#is", $text, $matches );
|
||||
}
|
||||
else
|
||||
{
|
||||
preg_match( "#$option(\s+?)?\=(\s+?)?[\"']?(.+?)([\"']|(\s+?)|$|>)#is", $text, $matches );
|
||||
}
|
||||
|
||||
//preg_match( "#$option(\s+?)?\=(\s+?)?[\"']?(.+?)([\"']|$|>|\s)#is", $text, $matches );
|
||||
return trim( $matches[3] );
|
||||
return isset($matches[3]) ? trim( $matches[3] ) : '';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user