Register
phpBB.com Wiki · Home Projects Help

root / trunk / phpBB / includes / bbcode.php

bbcode.php

View | Annotate | Download (15.7 KB)

# Date Author Comment
8954 View | Annotate 09/28/2008 07:09 PM acydburn

revert r8893 – there were massive problems with the display and select all code

8894 View | Annotate 09/19/2008 06:42 PM acydburn

support tabs in code selections (Bug #25445). Still does not solve the strange “4 spaces prefixed on every line” problem in firefox. :/

8572 View | Annotate 05/29/2008 02:25 PM acydburn

ok… i hope i haven’t messed too much with the code and everything is still working.
Changes:
- Ascraeus now uses constants for the phpbb root path and the php extension. This ensures more security for external applications and modifications (no more overwriting of root path and extension possible through insecure mods and register globals enabled) as well as no more globalizing needed.
- A second change implemented here is an additional short-hand-notation for append_sid(). It is allowed to omit the root path and extension now (for example calling append_sid(‘memberlist’)) – in this case the root path and extension get added automatically. The hook is called after these are added.

8477 View | Annotate 03/29/2008 01:08 AM naderman

Go away evil carriage returns\!

8295 View | Annotate 01/03/2008 06:00 PM davidmj

oh boy…
- Migrate code base to PHP 5.1+

8153 View | Annotate 10/07/2007 12:34 PM naderman

- Match custom BBCodes in the same way during first and second pass – patch provided by IBBoard [Bug #14268]

8146 View | Annotate 10/05/2007 04:30 PM acydburn

dumdidum… sorry. ;)

8056 View | Annotate 08/19/2007 11:29 PM naderman

- Prevent {URL} token in custom BBCodes from make_clickable messing [Bug #14151]
- Added alternative tokens to custom BBCodes which are safe for CSS/Javascript and changed TEXT token to entitise opening and closing parantheses.

8050 View | Annotate 08/19/2007 03:40 PM naderman

- BBCode parsing order should ALWAYS be censor_text(), bbcode_secon_pass(), bbcode_nl2br(), smiley_text(), parse_attachments()
- using \r on custom bbcodes to allow line breaks [Bug #10758]

7157 View | Annotate 03/09/2007 08:01 PM dhn2

#8576
Introducing percentage based font sizing for the font-site BBCode

7147 View | Annotate 03/08/2007 02:00 AM davidmj

#8456

7110 View | Annotate 03/02/2007 10:00 PM davidmj

blah, no need to capture this

7107 View | Annotate 03/02/2007 08:24 PM davidmj

#8374

6865 View | Annotate 01/09/2007 03:10 PM acydburn

- some bugfixes
- bugfixes for the convertor (typecasting for example was totally broken)

6777 View | Annotate 12/17/2006 06:59 PM davidmj

- Changed handling of the bitfield in bbcode.php
- #6270, reverted to an earlier version of list handling + bug fixes

6650 View | Annotate 11/24/2006 03:59 PM acydburn

rather large update, most important things done:
- implemented provided patch/diff file for bug #5350 (Highway of Life) with some tiny changes and alterations
- more username/colour changes/fixes
- added a note about PM rule-dependant message removals so the user is not wondering too much if he can’t remember his rules. :)
- some column changes to fix unicode issues
- bugfixes

6459 View | Annotate 10/07/2006 07:40 PM acydburn

he braces style is deprecated as of PHP 6

6391 View | Annotate 09/23/2006 01:37 PM acydburn

fix custom bbcode html replacement to correctly replace references
It failed if there was a number directly after the token, resulting in $12345, where $1 was needed. Fixed by using ${x}

also made sure that newlines within the html replacement are not replaced with
.

6271 View | Annotate 08/12/2006 03:14 PM acydburn

sql_in_set changes

6263 View | Annotate 08/11/2006 11:52 PM davidmj

so…. what does this thing do?

well, the super fast, ultra efficient, massively huge BBCode handling system was implemented differently on each DBMS. Although this provided the best performance, the solution was a bit hacky.

So what does this new thing do? We use base64 encoding to make everything nice and shiny, it turns into nice, safe characters that we can just jam into varchars on essentially any database. This has two implications: we must decode every bitfield we get AND we have slightly fewer IDs to work with. It goes down from 2040 BBCodes to 1512. We lose like a quarter of them :P

P.S. I hope nothing broke :P

6209 View | Annotate 07/24/2006 12:08 PM davidmj

OK…

This commit should increase the total number of BBCodes from 31 to 2040. Some things to watch out for:

Each database likes to deal with binary data in its own, special way. They are, quite frankly, too cool for school.

MySQL, MSSQL and Oracle all allow me to send in a default value for their binary column using a hex number. However, MSSQL forces me to send the specific data as a hex number and thus we must CAST it.

PostgreSQL allows me to set a binary column, but with a twist. It demands that the default be in octal and its datatype allows somewhere around a gigabyte’s worth of BBCodes ( PGSQL users, we shut you down to 2040 for your own good! )

Firebird has no decent mechanism for allowing me to shuttle in binary data so I must force my way in. By virtue of triggers and a UDF, we ram in our default values.

SQLite is the most bizarre of them all. They have no mechanism for turning an ASCII code into a ASCII character. Because of this, we have a trigger and a UDF (just like Firebird!) but with a twist! The UDF is defined on the PHP side of things instead of SQL. SQLite also demands that it’s data be encoded before being sent off.

Other notes:
- SQLite installs again :D
- Firebird nearly installs again :P
- Database backup is not screwed up :P

P.S.
I hope nothing broke :D

6165 View | Annotate 07/10/2006 05:55 PM acydburn

fix some bugs… again. :)

6105 View | Annotate 06/20/2006 02:09 AM davidmj

what? yeah…
- turns out the backup issue was not a backup issue but a schema issue
- let there be color

6073 View | Annotate 06/16/2006 06:54 PM acydburn

- removed db cache (might re-appear, but for now we do not see the need for it)
- all changes to styles/subsilver/template are purely cosmetic (no functional changes)
- cosmetics
- bugfixes
- add index to modules table
- use modules ordering code for forums too

6067 View | Annotate 06/15/2006 12:09 AM acydburn

erm, ok, my fault. :/

6058 View | Annotate 06/13/2006 11:06 PM acydburn

make sure custom profile fields are created correctly on registration (#2225)

6048 View | Annotate 06/11/2006 08:13 PM acydburn

- fixed a few bugs
- added user_add() function
- check posted images ([img]) for same domain/scipt and php files
- auth_api.html updated to the coding guidelines look&feel
- introduced ability to force non page-updates (cron is using it)
- correctly resend coppa email

6042 View | Annotate 06/10/2006 06:51 PM davidmj

- BBCode bugs
- PostgreSQL now gives us database info (if you are running 8.1 or have the dbsize contrib module installed)

5977 View | Annotate 05/28/2006 05:42 PM acydburn

- get every bbcode tpl block defined within bbcode.html. ;) (#1889)

5967 View | Annotate 05/26/2006 05:04 PM acydburn

some tiny changes…

5957 View | Annotate 05/21/2006 06:54 PM acydburn

- fixing a few smaller bugs/glitches
- init user session in cron.php (else it can produce errors if functions expect the user object being set)
- fix sql escaping for mssql/mssql_odbc

5737 View | Annotate 03/27/2006 11:32 PM acydburn

#1327

5422 View | Annotate 01/04/2006 07:37 AM davidmj

- file_get_contents instead of imploding file()s or fread()ing till the maximum filesize
- language and style properly use compression
- language now prompts user for methods
- functions_compress does not need to eval() to get a hex date, instead calls pack()
- A writing method is defined at the end of tar operations only if data has been sent to the archive
- BBCode parser does not have to eval(), it instead uses the regex to loop around the matches

Hopefully nothing broke :-)

5372 View | Annotate 12/22/2005 05:28 PM acydburn

- ok, get away with the secondary style approach (styles can be mixed together easily with the acp)
- introduce a more generic approach of defining some additional variables through cfg files as well as the name, copyright and version fields
- please note that at the moment this is in flux. I added it now for Tom because he needs the theme parameters.

5315 View | Annotate 11/30/2005 06:48 PM acydburn

- added acp_language (language pack management)
- minor adjustments to cope with PHP5.x

5114 View | Annotate 04/09/2005 02:26 PM acydburn

- Documentation related changes
- added resend activation email dialog
- fixed issue in session code
- log failed/successful admin re-authentication/login
- fixed simple forum dropdown box (used in mcp and posting)

5063 View | Annotate 01/15/2005 07:49 PM acydburn

- bugfixes
- do not hardcode url bbcode tag (please change the bitfield accordingly – see schema file!)

5035 View | Annotate 12/19/2004 06:59 PM acydburn

- some fixes/changes

5027 View | Annotate 11/14/2004 06:12 PM acydburn

- letting urls work again, fixing [code] breakage on urls, corrected magic_url to be able to parse urls at the beginning/end of bbcode blocks
- fixed “edited by” message.

5023 View | Annotate 11/06/2004 03:22 PM acydburn

- a bunch of updates, most of them bbcode related

4984 View | Annotate 09/16/2004 08:33 PM acydburn

- more updates, mostly bugfixes to the bbcode parser
- changed current_user in sessions (please review)
- give more flexibility to style authors in regard to the pagination elements
- profile fields updates (included a sample constuct into viewtopic_body.html – have to be documented extensivly)
- code optimizations (use of strpos, sizeof, loops not iterating functions on every call, memory savings…)
- and last but not least - hopefully not introduced more bugs than healthy (cough)

4978 View | Annotate 09/04/2004 09:32 PM acydburn

my turn to break the forum (and at least pm’s are no longer working – will not last long). HARRRR

4939 View | Annotate 07/27/2004 10:03 PM acydburn

trouble oh trouble… trouble oh trouble… trou… SLAP!

4937 View | Annotate 07/19/2004 10:13 PM acydburn

- approve/disapprove posts/topics
- changed mcp_front to be more moderator friendly
- able to change the forum in mcp_queue (for moderators moderating more than one forum)

4903 View | Annotate 05/30/2004 09:24 PM acydburn

- forum rules + link to forum rules
- three new (tiny) functions added to functions_posting responsible for handling text with bbcode/smilies/urls, use them at items all over across phpbb…
- some bugfixes within admin_forums and other files
- new admin_board layout (much safer, security wise)

4883 View | Annotate 05/02/2004 03:06 PM acydburn

fix some issues with oop, fixing small bugs and prepare the next steps…
NOTE TO DEVS: have a look at adm/admin_board.php (new config layout)

4819 View | Annotate 02/08/2004 07:02 PM acydburn

inline attachment capability…

4764 View | Annotate 01/25/2004 03:18 PM acydburn

do not parse smilies within code tag

4670 View | Annotate 11/16/2003 11:28 PM ludovic_arnaud

Not even worth a log msg ;)

4578 View | Annotate 10/12/2003 01:59 PM psotfx

Let’s break lots of things

4485 View | Annotate 09/07/2003 08:11 PM acydburn

username quoting should be working again…

4453 View | Annotate 08/28/2003 10:50 PM ludovic_arnaud

Added: admin definable bbcodes
Changed: preg references, use the prefered $n form instead of the old \\n one
Fixed: tweaked PHP highlightning a little

4378 View | Annotate 08/11/2003 12:41 PM psotfx

Correct pathname for template

4370 View | Annotate 08/10/2003 11:17 PM ludovic_arnaud

Less bug, more comments

4363 View | Annotate 08/10/2003 08:30 PM ludovic_arnaud

Primary / secondary style bbcode implementation. Not thoroughly tested yet but my test board still functions so I guess it works ;)

4329 View | Annotate 07/24/2003 06:10 PM psotfx

path change for bbcode

4236 View | Annotate 07/13/2003 05:15 PM psotfx

Cope with secondary (per forum) styles, probably other minor things too … there is a known permissions problem, will work on that soon. Ashe, the bbcode primary/secondary stuff may need some tightening, particularly since it only checks the bbcode_bitfield for the primary template (which may not exist as coped with later) ... I’ll leave that to you to alter.

4190 View | Annotate 07/03/2003 12:23 AM ludovic_arnaud

Shifting bits appears to be faster than the pow() function

4170 View | Annotate 06/24/2003 06:46 PM psotfx

Fix up display of sigs and bbcode for preview

4086 View | Annotate 06/05/2003 09:19 PM ludovic_arnaud

Changed: [list=square] is translated into an UNordered list
Fixed:

    opening tag
    Changed: [list] is not hardcoded anymore

4060 View | Annotate 05/25/2003 09:19 PM ludovic_arnaud

Added: width / height parameters to flash
Fixed: ol closing tag
Screwed-up: ol opening tag – will check that later

4043 View | Annotate 05/22/2003 03:26 AM ludovic_arnaud

Updated bbcode parser.
Images that are replace with a link according to user’s preferences now use the corresponding [url] template.
Some regular expressions have been made a little more restrictive.

4029 View | Annotate 05/20/2003 03:35 PM psotfx

This version tends to do what it was supposed to do … I guess users will prefer this …

4028 View | Annotate 05/20/2003 03:24 PM psotfx

Enable view limiting functions … Ashe, not sure if this is compatible with your thinking for bbcode but it seems the “logical” way to handle disabling of bbcode/flash in this manner. Fixed issue with automatic url handling of local links

4014 View | Annotate 05/19/2003 01:26 AM ludovic_arnaud

Added: [/] tag (list item end tag). Automagically added if needed, in which case it’s stored as [/:m:$uid]
Added: any {L_*} var in bbcode.html is replaced by its matching $lang string

4010 View | Annotate 05/17/2003 07:33 PM acydburn

prepared (and fixed) topic review.

4005 View | Annotate 05/11/2003 06:21 PM acydburn

a few updates, added #539865 and #694413.

3934 View | Annotate 04/23/2003 11:47 PM ludovic_arnaud

Changed: the loading of bbcodes template is triggered whenever needed – see bbcode_tpl()
Changed: [flash] got templated

3914 View | Annotate 04/22/2003 02:42 AM psotfx

Move second parse cache init after assignment of bitfield … in case bitfield isn’t set globally

3901 View | Annotate 04/20/2003 10:30 PM ludovic_arnaud

First-pass syntax highlightning. Will fix quotes later

3879 View | Annotate 04/18/2003 01:47 AM ludovic_arnaud

More bbcode fixes

3863 View | Annotate 04/17/2003 12:44 AM ludovic_arnaud

Added syntax highlitning to [code]. Added [flash] tag.

3861 View | Annotate 04/17/2003 12:32 AM psotfx

Added some extra ’s’ extensions to preg_matches to cope with multiline data

3812 View | Annotate 04/11/2003 02:19 AM ludovic_arnaud

BBCode parser + decoder, missing some tags and mildly broken at this time

2997 View | Annotate 11/01/2002 01:23 PM psotfx

Various, typically posting related updates

2983 View | Annotate 10/30/2002 01:57 AM psotfx

Changed $board_config to $config, more posting “stuff”, altered polling code in viewtopic and loads of new problems, poor coding, etc. created :)

2669 View | Annotate 07/14/2002 04:41 PM psotfx

Various updates and alterations

2630 View | Annotate 06/10/2002 03:52 AM psotfx

Updates in line with 2.0.1

2544 View | Annotate 04/24/2002 05:00 PM the_systech

Fix for “security vulnerability” in img tag

2532 View | Annotate 04/20/2002 02:22 AM psotfx

merged from 2.0.0 branch (marked merge_point_20020420) + assorted updates and trial stuff for example session alterations

2427 View | Annotate 03/25/2002 01:41 PM psotfx

Move phpbb_preg_quote back into functions because it’s plain annoying … :D

2318 View | Annotate 03/18/2002 06:46 PM thefinn

Fixed little bug that made the smilies image tags not XHTML compatible

2317 View | Annotate 03/18/2002 06:21 PM the_systech

Fix for bug #529642… Tabs should end parsing for magic urls as well as spaces or newlines…

2304 View | Annotate 03/18/2002 02:35 PM psotfx

Updates to overcome security issue + updates of various functions, initial version of profile registration include … not completed but should be functional for obvious reasons(!)

2175 View | Annotate 02/17/2002 05:05 PM bartvb

Fixed #506066, [img] didn’t work with multiple instances directly following each other

2115 View | Annotate 02/12/2002 06:55 PM psotfx

doh

2114 View | Annotate 02/12/2002 06:53 PM psotfx

Minor change to email match

2063 View | Annotate 02/08/2002 02:33 AM psotfx

Various updates, mods, changes to several functions, moved smilies stuff to bbcode.php … nathan may kill me … good bye all in advance

1989 View | Annotate 01/28/2002 01:27 PM psotfx

Add a ; to URI validation rex

1983 View | Annotate 01/28/2002 03:24 AM psotfx

And another …

1982 View | Annotate 01/28/2002 03:16 AM psotfx

Couple more updates to URL ‘fixes’

1969 View | Annotate 01/27/2002 03:03 PM psotfx

arrgghhhhh I hate regexp

1968 View | Annotate 01/27/2002 02:59 PM psotfx

alphaNUMERICS Paul, ... doh

1967 View | Annotate 01/27/2002 02:53 PM psotfx

Check for allowed chars in [url] submissions … could use some double checking

1824 View | Annotate 01/09/2002 02:39 AM the_systech

!!$## gotta stop testing on one machine and commiting changes on another… I mistyped one word, and broke quotes completely. :( Somebody please get me a beer

1822 View | Annotate 01/08/2002 08:00 PM the_systech

trimmed down the quote bug fix in second pass to one preg_replace rather than two, by changing the pattern up a bit…

1818 View | Annotate 01/08/2002 04:51 PM the_systech

Fix for bug #496944 “quotes with usernames containing “]”

1555 View | Annotate 12/11/2001 10:13 AM natec

bug #489842—some pages were doing bbencode_second and make_click in a bad order.

1520 View | Annotate 12/07/2001 12:39 AM natec

fixed [code] bbcode linebreaking nbsp; stuff.

1457 View | Annotate 11/26/2001 10:40 PM bartvb

Removed uniqid() from make_bbcode_uid(). uniqid() was doing absolutely nothing for 20ms on each call ;(

1448 View | Annotate 11/26/2001 09:15 AM natec

tabs-to-spaces and other indentation mojo for [code] bbcode.

1441 View | Annotate 11/26/2001 12:31 AM natec

Fixed bug 478218—[ and ] in usernames qith quote= bbcode. Usernames can no longer contain the double-quote character. Also removed a dupe from lang_main file.

1243 View | Annotate 10/25/2001 12:52 AM natec

[quote=username] bbcode.

1238 View | Annotate 10/19/2001 03:28 PM dougk_ff7

Removing traces of global announcements and also fixing a potential security hole in bbcode. Img-based javascript is now stripped. All images have to begin with http://>

1111 View | Annotate 10/02/2001 01:22 AM psotfx

Changes related to private messaging + some bug fixes

1095 View | Annotate 09/27/2001 12:48 AM natec

Templated bbcode.

1092 View | Annotate 09/26/2001 11:43 PM psotfx

color and size tags

997 View | Annotate 09/07/2001 01:30 AM psotfx

Added underlined text [u][/u]

987 View | Annotate 09/06/2001 02:29 AM psotfx

Numerous updates and additions for polling and assorted fixes … or bugs, whichever they turn out to be

943 View | Annotate 08/31/2001 12:20 AM thefinn

Re-added GPL disclaimers

933 View | Annotate 08/26/2001 04:04 PM psotfx

Modified header comments

836 View | Annotate 08/11/2001 12:00 AM psotfx

Various posting updates

792 View | Annotate 08/02/2001 10:36 AM thefinn

Beginnings of the forum managament code (no functionality yet). Also a bit of a fix to view topic so it dosan’t screw up when HTML is turned off. Still needs work, HTML works in [quote] tags… havn’t tracked it down yet. Nate should look at it!

328 View | Annotate 05/26/2001 02:25 AM thefinn

Lots of work on posting. New topic and reply functionality is mostly done. Edit post loads the form but needs database functionality
All this is only been tested on Postgres, donno if it works as well on MySQL yet, will test when I can get access to sourceforge again

228 View | Annotate 05/02/2001 07:46 PM thefinn

Ran John’s fix_files script to fix all the windows carriage returns.
Also added the script in the develop dir. To use it copy it to the phpBB2 root dir and run it

182 View | Annotate 04/19/2001 03:18 PM psotfx

Moved all included files to includes