php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25680 BB-Parser produce a notice for invalid bb-code
Submitted: 2003-09-28 11:55 UTC Modified: 2004-09-01 16:29 UTC
From: Progman2002 at gmx dot de Assigned:
Status: Not a bug Package: PEAR related
PHP Version: Irrelevant OS: linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
30 + 13 = ?
Subscribe to this entry?

 
 [2003-09-28 11:55 UTC] Progman2002 at gmx dot de
Description:
------------
If you use an empty bb-code "[]" or any other invalid BB-Code which doesn't match [a-z]+, php produce the following Notice:

Notice: Undefined offset: 1 in /usr/lib/php/HTML/BBCodeParser.php on line 386

I have written a patch to fix this:
http://progman.it-pc.de/diff/BBCodeParser.diff

Reproduce code:
---------------
<?php
    error_reporting(E_ALL);
    require_once 'HTML/BBCodeParser.php';

    echo HTML_BBCodeParser::staticQParse('foo[]bar');
?>

Expected result:
----------------
foo[]bar

Actual result:
--------------
Notice: Undefined offset: 1 in /usr/lib/php/HTML/BBCodeParser.php on line 386
foo[]bar

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-09-01 16:29 UTC] alan_k@php.net
can you report this on pear.php.net if the problem still exists - where the package maintainers now manage pear bugs
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 10 22:01:32 2024 UTC