| Jakub Vrana 2004-05-26, 5:35 am |
| Ilia Alshanetsky wrote:
> - switch (count($parts)) {
> - case 4:
> - $id = 'function.' . $parts[3];
> - $func_name = lookup_title($id);
> - break;
> -
> - case 5:
> - if ($parts[3] == 'class') {
> - $id = 'class.' . $parts[4];
> - $func_name = str_replace('-', '_', $parts[4]);
> - $stag = "xref linkend=\"$id\"";
> - $etag = "xref";
> - break;
> - }
> - /* fall through */
> -
> - default:
> - /* some weird node type we don't understand */
> - $id = $ref;
> - $func_name = 'Unknown ??';
> + if (isset($parts[4]) && $parts[3] == 'class') {
> + $id = 'class.' . $parts[4];
> + $func_name = str_replace('-', '_', $parts[4]);
> + $stag = "xref linkend=\"$id\"";
> + $etag = "xref";
> + } else if (isset($parts[3])) {
> + $id = 'function.' . $parts[3];
> + $func_name = lookup_title($id);
> + } else {
> + /* some weird node type we don't understand */
> + $id = $ref;
> + $func_name = 'Unknown ??';
> }
This is overtuned, here's the patch.
Jakub Vrana
|