aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions.php
diff options
context:
space:
mode:
authorDavid M <davidmj@users.sourceforge.net>2006-07-17 03:23:31 +0000
committerDavid M <davidmj@users.sourceforge.net>2006-07-17 03:23:31 +0000
commitfa205b922dcfa09bab26b6cf9d406d2afe1a0518 (patch)
treeb442ec1e2e368bdf2476028e7b4de82ad83e5a97 /phpBB/includes/functions.php
parent29d92430c5e364d63a5ec7db96d306cdf1c02e72 (diff)
downloadforums-fa205b922dcfa09bab26b6cf9d406d2afe1a0518.tar
forums-fa205b922dcfa09bab26b6cf9d406d2afe1a0518.tar.gz
forums-fa205b922dcfa09bab26b6cf9d406d2afe1a0518.tar.bz2
forums-fa205b922dcfa09bab26b6cf9d406d2afe1a0518.tar.xz
forums-fa205b922dcfa09bab26b6cf9d406d2afe1a0518.zip
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
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r--phpBB/includes/functions.php26
1 files changed, 6 insertions, 20 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index e357435fcc..c5d5b2f2a3 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -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(