@@ -56,7 +56,7 @@ discard block  | 
                                                    ||
| 56 | 56 |      public function handleTplMetaheaderOutput(Doku_Event $event, $param) { | 
                                                        
| 57 | 57 | global $ID, $conf, $INFO;  | 
                                                        
| 58 | 58 | |
| 59 | -        if(!page_exists($ID)) { | 
                                                        |
| 59 | +        if (!page_exists($ID)) { | 
                                                        |
| 60 | 60 | return;  | 
                                                        
| 61 | 61 | }  | 
                                                        
| 62 | 62 | |
@@ -78,7 +78,7 @@ discard block  | 
                                                    ||
| 78 | 78 | );  | 
                                                        
| 79 | 79 | |
| 80 | 80 | $desc = p_get_metadata($ID, 'description', true);  | 
                                                        
| 81 | -        if(!empty($desc)) { | 
                                                        |
| 81 | +        if (!empty($desc)) { | 
                                                        |
| 82 | 82 |              $desc                  = str_replace("\n", " ", $desc['abstract']); | 
                                                        
| 83 | 83 | $event->data['meta'][] = array(  | 
                                                        
| 84 | 84 | 'name' => 'twitter:description',  | 
                                                        
@@ -86,7 +86,7 @@ discard block  | 
                                                    ||
| 86 | 86 | );  | 
                                                        
| 87 | 87 | }  | 
                                                        
| 88 | 88 | |
| 89 | -        if($this->getConf('twitterUserName') != '') { | 
                                                        |
| 89 | +        if ($this->getConf('twitterUserName') != '') { | 
                                                        |
| 90 | 90 | $event->data['meta'][] = array(  | 
                                                        
| 91 | 91 | 'name' => 'twitter:creator',  | 
                                                        
| 92 | 92 |                  'content' => $this->getConf('twitterUserName'), | 
                                                        
@@ -132,7 +132,7 @@ discard block  | 
                                                    ||
| 132 | 132 | 'property' => 'og:title',  | 
                                                        
| 133 | 133 | 'content' => p_get_metadata($ID, 'title', true),  | 
                                                        
| 134 | 134 | );  | 
                                                        
| 135 | -        if(!empty($desc)) { | 
                                                        |
| 135 | +        if (!empty($desc)) { | 
                                                        |
| 136 | 136 | $event->data['meta'][] = array(  | 
                                                        
| 137 | 137 | 'property' => 'og:description',  | 
                                                        
| 138 | 138 | 'content' => $desc,  | 
                                                        
@@ -166,11 +166,11 @@ discard block  | 
                                                    ||
| 166 | 166 |          // $event->data['meta'][] = array('property' => 'article:author','content' => p_get_metadata($ID,'creator',true),); | 
                                                        
| 167 | 167 |          // $event->data['meta'][] = array('property' => 'article:author','content' => p_get_metadata($ID,'user',true),); | 
                                                        
| 168 | 168 | $_subject = p_get_metadata($ID, 'subject', true);  | 
                                                        
| 169 | -        if(!empty($_subject)) { | 
                                                        |
| 170 | -            if(!is_array($_subject)) { | 
                                                        |
| 169 | +        if (!empty($_subject)) { | 
                                                        |
| 170 | +            if (!is_array($_subject)) { | 
                                                        |
| 171 | 171 | $_subject = array($_subject);  | 
                                                        
| 172 | 172 | }  | 
                                                        
| 173 | -            foreach($_subject as $tag) { | 
                                                        |
| 173 | +            foreach ($_subject as $tag) { | 
                                                        |
| 174 | 174 | $event->data['meta'][] = array(  | 
                                                        
| 175 | 175 | 'property' => 'article:tag',  | 
                                                        
| 176 | 176 | 'content' => $tag,  | 
                                                        
@@ -182,7 +182,7 @@ discard block  | 
                                                    ||
| 182 | 182 | $geotags = p_get_metadata($ID, 'geo', true);  | 
                                                        
| 183 | 183 | $lat = $geotags['lat'];  | 
                                                        
| 184 | 184 | $lon = $geotags['lon'];  | 
                                                        
| 185 | -        if(!(empty($lat) && empty($lon))) { | 
                                                        |
| 185 | +        if (!(empty($lat) && empty($lon))) { | 
                                                        |
| 186 | 186 | $event->data['meta'][] = array(  | 
                                                        
| 187 | 187 | 'property' => 'place:location:latitude',  | 
                                                        
| 188 | 188 | 'content' => $lat,  | 
                                                        
@@ -194,7 +194,7 @@ discard block  | 
                                                    ||
| 194 | 194 | }  | 
                                                        
| 195 | 195 | // see https://developers.facebook.com/docs/opengraph/property-types/#geopoint  | 
                                                        
| 196 | 196 | $alt = $geotags['alt'];  | 
                                                        
| 197 | -        if(!empty($alt)) { | 
                                                        |
| 197 | +        if (!empty($alt)) { | 
                                                        |
| 198 | 198 | // facebook expects feet...  | 
                                                        
| 199 | 199 | $alt = $alt * 3.2808;  | 
                                                        
| 200 | 200 | $event->data['meta'][] = array(  | 
                                                        
@@ -214,7 +214,7 @@ discard block  | 
                                                    ||
| 214 | 214 | |
| 215 | 215 | // optional facebook app ID  | 
                                                        
| 216 | 216 |          $appId = $this->getConf('fbAppId'); | 
                                                        
| 217 | -        if(!empty($appId)) { | 
                                                        |
| 217 | +        if (!empty($appId)) { | 
                                                        |
| 218 | 218 | $event->data['meta'][] = array(  | 
                                                        
| 219 | 219 | 'property' => 'fb:app_id',  | 
                                                        
| 220 | 220 | 'content' => $appId,  | 
                                                        
@@ -233,9 +233,9 @@ discard block  | 
                                                    ||
| 233 | 233 | $rel = p_get_metadata($ID, 'relation', true);  | 
                                                        
| 234 | 234 | $img = $rel['firstimage'];  | 
                                                        
| 235 | 235 | |
| 236 | -        if(empty($img)) { | 
                                                        |
| 236 | +        if (empty($img)) { | 
                                                        |
| 237 | 237 |              $img = $this->getConf('fallbackImage'); | 
                                                        
| 238 | -            if(substr($img, 0, 4) === "http") { | 
                                                        |
| 238 | +            if (substr($img, 0, 4) === "http") { | 
                                                        |
| 239 | 239 | // don't use ml() as this results in a HTTP redirect after  | 
                                                        
| 240 | 240 | // hitting the wiki making the card image fail.  | 
                                                        
| 241 | 241 | return $img;  | 
                                                        
@@ -257,7 +257,7 @@ discard block  | 
                                                    ||
| 257 | 257 | $imgID = $rel['firstimage'];  | 
                                                        
| 258 | 258 | $alt = "";  | 
                                                        
| 259 | 259 | |
| 260 | -        if(!empty($imgID)) { | 
                                                        |
| 260 | +        if (!empty($imgID)) { | 
                                                        |
| 261 | 261 | require_once(DOKU_INC . 'inc/JpegMeta.php');  | 
                                                        
| 262 | 262 | $jpegmeta = new JpegMeta(mediaFN($imgID));  | 
                                                        
| 263 | 263 | $tags = array(  | 
                                                        
@@ -268,7 +268,7 @@ discard block  | 
                                                    ||
| 268 | 268 | 'IPTC.Headline',  | 
                                                        
| 269 | 269 | 'Xmp.dc:title'  | 
                                                        
| 270 | 270 | );  | 
                                                        
| 271 | - $alt = media_getTag($tags, $jpegmeta, "");  | 
                                                        |
| 271 | + $alt = media_getTag($tags, $jpegmeta, "");  | 
                                                        |
| 272 | 272 | }  | 
                                                        
| 273 | 273 | return htmlspecialchars($alt);  | 
                                                        
| 274 | 274 | }  | 
                                                        
@@ -35,7 +35,7 @@  | 
                                                    ||
| 35 | 35 | }  | 
                                                        
| 36 | 36 | |
| 37 | 37 |      public function testHeaders() { | 
                                                        
| 38 | - $request = new TestRequest();  | 
                                                        |
| 38 | + $request = new TestRequest();  | 
                                                        |
| 39 | 39 | $params = array(  | 
                                                        
| 40 | 40 | 'id' => 'wiki:dokuwiki'  | 
                                                        
| 41 | 41 | );  |