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
 [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-2020 The PHP Group
All rights reserved.
Last updated: Wed Feb 26 13:01:27 2020 UTC