Opened 16 years ago
Closed 16 years ago
#9336 closed task (blessed) (fixed)
E_NOTICE undefined offset in wp-includes/theme.php
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 2.8 | Priority: | lowest |
Severity: | trivial | Version: | 2.7.1 |
Component: | Themes | Keywords: | has-patch theme |
Focuses: | Cc: |
Description
With my Error Reporting plugin I get
E_NOTICE
Undefined offset: 1 at /home/mittineague/mittineague.com/blog/wp-includes/theme.php (212)
timed at 15-Mar-2009 01:53:41
eg. (several similar lines)
{{{if ( preg_match( '|Author URI:(.*)$|mi', $theme_data, $author_uri ) )
$author_uri = clean_url( trim( $author_uri[1]) );}}}
preg_match returns FALSE upon an error, or 0 or 1 $matches found. It is possible for no $matches to be found causing $matches[1] to be undefined using the conditional if ( preg_match() )
Attachments (1)
Change History (5)
#3
in reply to:
↑ 2
@
16 years ago
- Keywords has-patch theme added
- Milestone changed from Unassigned to 2.8
Replying to DD32:
Changing the regex's to (.+) should fix this possibility?
No, because if you had for example just "Theme URI:" the parentheses would capture nothing and put it in $theme_uri[1]
, avoiding the undefined notice. This happens when there's no Theme URI line whatsoever; the preg_match returns false, but later on the $theme_uri[1] is used.
Changing the regex's to (.+) should fix this possibility?