mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-06 16:56:44 +02:00
hmm... This commit does not increase the number of BBCodes. However, this does other things that we need to do first. This splits the usage of allow_* from the BBCode bitfield in forum descriptions, forum rules and group descriptions. This also fixes a tiny, tiny severe issue that nobody found :D I hope it works :P
git-svn-id: file:///svn/phpbb/trunk@6188 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -1811,7 +1811,7 @@ function decode_message(&$message, $bbcode_uid = '')
|
||||
* For display of custom parsed text on user-facing pages
|
||||
* Expects $text to be the value directly from the database (stored value)
|
||||
*/
|
||||
function generate_text_for_display($text, $uid, $bitfield)
|
||||
function generate_text_for_display($text, $uid, $bitfield, $flags)
|
||||
{
|
||||
global $__bbcode;
|
||||
|
||||
@@ -1820,13 +1820,6 @@ function generate_text_for_display($text, $uid, $bitfield)
|
||||
return '';
|
||||
}
|
||||
|
||||
// Get flags... they are always allow_bbcode, allow_smilies and allow_urls
|
||||
$flags = $bitfield;
|
||||
if ($flags >> 3)
|
||||
{
|
||||
$flags = bindec(substr(decbin($flags), strlen(decbin($flags >> 3))));
|
||||
}
|
||||
|
||||
// Parse bbcode if bbcode uid stored and bbcode enabled
|
||||
if ($uid && ($flags & 1))
|
||||
{
|
||||
@@ -1838,11 +1831,11 @@ function generate_text_for_display($text, $uid, $bitfield)
|
||||
|
||||
if (empty($__bbcode))
|
||||
{
|
||||
$__bbcode = new bbcode($bitfield >> 3);
|
||||
$__bbcode = new bbcode($bitfield);
|
||||
}
|
||||
else
|
||||
{
|
||||
$__bbcode->bbcode($bitfield >> 3);
|
||||
$__bbcode->bbcode($bitfield);
|
||||
}
|
||||
|
||||
$__bbcode->bbcode_second_pass($text, $uid);
|
||||
@@ -1859,7 +1852,7 @@ function generate_text_for_display($text, $uid, $bitfield)
|
||||
* This function additionally returns the uid and bitfield that needs to be stored.
|
||||
* Expects $text to be the value directly from request_var() and in it's non-parsed form
|
||||
*/
|
||||
function generate_text_for_storage(&$text, &$uid, &$bitfield, $allow_bbcode = false, $allow_urls = false, $allow_smilies = false)
|
||||
function generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bbcode = false, $allow_urls = false, $allow_smilies = false)
|
||||
{
|
||||
global $phpbb_root_path, $phpEx;
|
||||
|
||||
@@ -1889,7 +1882,7 @@ function generate_text_for_storage(&$text, &$uid, &$bitfield, $allow_bbcode = fa
|
||||
}
|
||||
|
||||
$flags = (($allow_bbcode) ? 1 : 0) + (($allow_smilies) ? 2 : 0) + (($allow_urls) ? 4 : 0);
|
||||
$bitfield = $flags + ($message_parser->bbcode_bitfield << 3);
|
||||
$bitfield = $message_parser->bbcode_bitfield;
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -1898,17 +1891,10 @@ function generate_text_for_storage(&$text, &$uid, &$bitfield, $allow_bbcode = fa
|
||||
* For decoding custom parsed text for edits as well as extracting the flags
|
||||
* Expects $text to be the value directly from the database (pre-parsed content)
|
||||
*/
|
||||
function generate_text_for_edit($text, $uid, $bitfield)
|
||||
function generate_text_for_edit($text, $uid, $flags)
|
||||
{
|
||||
global $phpbb_root_path, $phpEx;
|
||||
|
||||
// Get forum flags...
|
||||
$flags = $bitfield;
|
||||
if ($flags >> 3)
|
||||
{
|
||||
$flags = bindec(substr(decbin($flags), strlen(decbin($flags >> 3))));
|
||||
}
|
||||
|
||||
decode_message($text, $uid);
|
||||
|
||||
return array(
|
||||
|
Reference in New Issue
Block a user