#5105 closed defect (bug) (duplicate)
Patch (formatting.php): notice-level error is being accidentally thrown
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 2.3 |
| Component: | General | Keywords: | |
| Focuses: | Cc: |
Description
The following line in formatting.php throws a notice-leve error (Uninitialized String Offset) if '$curl' is an empty string:
29: if (isset($curl{0}) && '<' != $curl{0} && $next) { If it's not a tag
Clearly, isset($curl{0}) is intended to prevent empty strings from being tested, but isset doesn't check string offsets.
Changing to the following prevents empty strings from being considered:
if ($curl && '<' != $curl{0} && $next) { If it's not a tag
Attachments (1)
Change History (5)
#2
@
18 years ago
Well, if you are checking to see if it is not empty, then you should use !empty().
if ( !empty($curl) && '<' != $curl{0} && $next ) { // If it isn't a tag
Should be used instead.
Note: See
TracTickets for help on using
tickets.
Patch