Results 1 to 3 of 3

Thread: [RESOLVED] Parsing BB code

  1. #1

    Thread Starter
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    Resolved [RESOLVED] Parsing BB code

    I'd like to include some BB like tags for my website. It's not difficult to implement some like [b] and [i] because you can just use str_replace with a span with the correct style and just check for even numbers of starting and ending so it doesn't mess up the page.

    What I'm not sure about is including a url or img tag. The img tag shouldn't be difficult but I heard there were security vulnerabilities with vBull's img tag and I want to make sure I don't make the same mistake. I also don't understand how to parse the url tag as it could be url www.vbforums.com /url or url=www.vbforums.com VBForums[/url] Again, I want to make sure I'm not opening myself up to attacks.

    Is there any funcitons built into PHP geared towards this or any functionality like this already written and proven that would allow me to use it in my website?

    EDIT: Unfortunately I couldn't put in the proper BB codes but you should get the idea
    Last edited by Kasracer; Jun 20th, 2006 at 10:20 PM.
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Parsing BB code

    I do,

    I have a BB code parser here, it's could be better but it does the job.
    http://dev.penagate.spiralmindsinc.c...er/bbcode.phps

    the [img] tags might be a little weird. I'm not sure which version of the code that is

    If you want me to pick apart any of that for you I'll do so.

  3. #3

    Thread Starter
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    Re: Parsing BB code

    Thanks! I'm never good with regex but I should be able to work from that
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width