Index: trunk/extensions/Icon/Icon.php |
— | — | @@ -55,20 +55,22 @@ |
56 | 56 | $ptitle = Title::newFromText( $page ); |
57 | 57 | |
58 | 58 | // this might happen in templates... |
59 | | - if (!is_object( $ptitle )) |
60 | | - return 'IconLink: invalid title name.'; |
61 | | - |
62 | | - if ( $ptitle->isLocal() ) |
63 | | - { |
64 | | - $tURL = $ptitle->getLocalUrl(); |
65 | | - $aClass=''; |
| 59 | + if (!is_object( $ptitle )) { |
| 60 | + //May be too assuming... w/e. |
| 61 | + $output = $imageString; |
| 62 | + } else { |
| 63 | + if ( $ptitle->isLocal() ) |
| 64 | + { |
| 65 | + $tURL = $ptitle->getLocalUrl(); |
| 66 | + $aClass=''; |
| 67 | + } |
| 68 | + else |
| 69 | + { |
| 70 | + $tURL = $ptitle->getFullURL(); |
| 71 | + $aClass = 'class="extiw"'; |
| 72 | + } |
| 73 | + $output = "<a ".$aClass." href='${tURL}'>{$imageString}</a>"; |
66 | 74 | } |
67 | | - else |
68 | | - { |
69 | | - $tURL = $ptitle->getFullURL(); |
70 | | - $aClass = 'class="extiw"'; |
71 | | - } |
72 | | - $output = "<a ".$aClass." href='${tURL}'>{$imageString}</a>"; |
73 | 75 | } else { |
74 | 76 | $output = $imageString; |
75 | 77 | } |