Index: trunk/extensions/OpenSearchXml/ApiOpenSearchXml.php |
— | — | @@ -67,11 +67,11 @@ |
68 | 68 | */ |
69 | 69 | protected function inXmlMode() { |
70 | 70 | $format = $this->validateFormat(); |
71 | | - return ($format == 'xml' || $format == 'xmlfm'); |
| 71 | + return ( $format == 'xml' || $format == 'xmlfm' ); |
72 | 72 | } |
73 | 73 | |
74 | 74 | public function execute() { |
75 | | - if (!$this->inXmlMode()) { |
| 75 | + if ( !$this->inXmlMode() ) { |
76 | 76 | // Pass back to the JSON defaults |
77 | 77 | parent::execute(); |
78 | 78 | return; |
— | — | @@ -138,11 +138,14 @@ |
139 | 139 | $item['Url']['*'] = wfExpandUrl( $title->getFullUrl(), PROTO_CURRENT ); |
140 | 140 | if( $image ) { |
141 | 141 | $thumb = $image->transform( array( 'width' => 50, 'height' => 50 ), 0 ); |
142 | | - $item['Image'] = array( |
143 | | - 'source' => wfExpandUrl( $thumb->getUrl(), PROTO_CURRENT ), |
144 | | - //alt |
145 | | - 'width' => $thumb->getWidth(), |
146 | | - 'height' => $thumb->getHeight() ); |
| 142 | + if( $thumb ) { |
| 143 | + $item['Image'] = array( |
| 144 | + 'source' => wfExpandUrl( $thumb->getUrl(), PROTO_CURRENT ), |
| 145 | + //alt |
| 146 | + 'width' => $thumb->getWidth(), |
| 147 | + 'height' => $thumb->getHeight() |
| 148 | + ); |
| 149 | + } |
147 | 150 | } |
148 | 151 | } else { |
149 | 152 | $item = array( 'Text' => array( '*' => $name ) ); |