@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | public function handleTplMetaheaderOutput(Doku_Event $event, $param): void { |
| 56 | 56 | global $ID, $conf, $INFO; |
| 57 | 57 | |
| 58 | - if(!page_exists($ID)) { |
|
| 58 | + if (!page_exists($ID)) { |
|
| 59 | 59 | return; |
| 60 | 60 | } |
| 61 | 61 | |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | ); |
| 78 | 78 | |
| 79 | 79 | $desc = p_get_metadata($ID, 'description', true); |
| 80 | - if(!empty($desc)) { |
|
| 80 | + if (!empty($desc)) { |
|
| 81 | 81 | $desc = str_replace("\n", " ", $desc['abstract']); |
| 82 | 82 | $event->data['meta'][] = array( |
| 83 | 83 | 'name' => 'twitter:description', |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | ); |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | - if($this->getConf('twitterUserName') !== '') { |
|
| 88 | + if ($this->getConf('twitterUserName') !== '') { |
|
| 89 | 89 | $event->data['meta'][] = array( |
| 90 | 90 | 'name' => 'twitter:creator', |
| 91 | 91 | '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, |
@@ -172,11 +172,11 @@ discard block |
||
| 172 | 172 | // 'content' => p_get_metadata($ID, 'user', true), |
| 173 | 173 | // ); |
| 174 | 174 | $_subject = p_get_metadata($ID, 'subject', true); |
| 175 | - if(!empty($_subject)) { |
|
| 176 | - if(!is_array($_subject)) { |
|
| 175 | + if (!empty($_subject)) { |
|
| 176 | + if (!is_array($_subject)) { |
|
| 177 | 177 | $_subject = array($_subject); |
| 178 | 178 | } |
| 179 | - foreach($_subject as $tag) { |
|
| 179 | + foreach ($_subject as $tag) { |
|
| 180 | 180 | $event->data['meta'][] = array( |
| 181 | 181 | 'property' => 'article:tag', |
| 182 | 182 | 'content' => $tag, |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | $geotags = p_get_metadata($ID, 'geo', true); |
| 189 | 189 | $lat = $geotags['lat']; |
| 190 | 190 | $lon = $geotags['lon']; |
| 191 | - if(!(empty($lat) && empty($lon))) { |
|
| 191 | + if (!(empty($lat) && empty($lon))) { |
|
| 192 | 192 | $event->data['meta'][] = array( |
| 193 | 193 | 'property' => 'place:location:latitude', |
| 194 | 194 | 'content' => $lat, |
@@ -200,9 +200,9 @@ discard block |
||
| 200 | 200 | } |
| 201 | 201 | // see https://developers.facebook.com/docs/opengraph/property-types/#geopoint |
| 202 | 202 | $alt = $geotags['alt']; |
| 203 | - if(!empty($alt)) { |
|
| 203 | + if (!empty($alt)) { |
|
| 204 | 204 | // facebook expects feet... |
| 205 | - $alt *= 3.2808; |
|
| 205 | + $alt *= 3.2808; |
|
| 206 | 206 | $event->data['meta'][] = array( |
| 207 | 207 | 'property' => 'place:location:altitude', |
| 208 | 208 | 'content' => $alt, |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | |
| 227 | 227 | // optional facebook app ID |
| 228 | 228 | $appId = $this->getConf('fbAppId'); |
| 229 | - if(!empty($appId)) { |
|
| 229 | + if (!empty($appId)) { |
|
| 230 | 230 | $event->data['meta'][] = array( |
| 231 | 231 | 'property' => 'fb:app_id', |
| 232 | 232 | 'content' => $appId, |
@@ -245,9 +245,9 @@ discard block |
||
| 245 | 245 | $rel = p_get_metadata($ID, 'relation', true); |
| 246 | 246 | $img = $rel['firstimage']; |
| 247 | 247 | |
| 248 | - if(empty($img)) { |
|
| 248 | + if (empty($img)) { |
|
| 249 | 249 | $img = $this->getConf('fallbackImage'); |
| 250 | - if(strpos($img, "http") === 0) { |
|
| 250 | + if (strpos($img, "http") === 0) { |
|
| 251 | 251 | // don't use ml() as this results in a HTTP redirect after |
| 252 | 252 | // hitting the wiki making the card image fail. |
| 253 | 253 | return $img; |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | $imgID = $rel['firstimage']; |
| 270 | 270 | $alt = ""; |
| 271 | 271 | |
| 272 | - if(!empty($imgID)) { |
|
| 272 | + if (!empty($imgID)) { |
|
| 273 | 273 | require_once(DOKU_INC . 'inc/JpegMeta.php'); |
| 274 | 274 | $jpegmeta = new JpegMeta(mediaFN($imgID)); |
| 275 | 275 | $tags = array( |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | 'IPTC.Headline', |
| 281 | 281 | 'Xmp.dc:title' |
| 282 | 282 | ); |
| 283 | - $alt = media_getTag($tags, $jpegmeta, ""); |
|
| 283 | + $alt = media_getTag($tags, $jpegmeta, ""); |
|
| 284 | 284 | } |
| 285 | 285 | return htmlspecialchars($alt); |
| 286 | 286 | } |