empty titles used when file_name would be better

seanburlington - June 7, 2008 - 14:23
Project:API
Version:HEAD
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

in file

// $Id: parser.inc,v 1.24.2.13 2007/11/16 19:56:52 drumm Exp $

the api_parse_html_file() function looks for a page title like this

if (preg_match('!(.*)!is', $source, $title_match)) {
$docblocks[0]['title'] = $title_match[1];
}

but the regex matches the empty string.

An empty title means you can't search for the file, and as search is the main navigation tool for api pages this is quite a big problem.

This regex will only match non-empty titles (leaving the title as the default - which is file_name)
if (preg_match('!(.+)!is', $source, $title_match)) {

 
 

Drupal is a registered trademark of Dries Buytaert.