@@ -55,10 +55,10 @@ 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 | - if(auth_quickaclcheck($ID) < AUTH_READ) { |
|
61 | + if (auth_quickaclcheck($ID) < AUTH_READ) { |
|
62 | 62 | return; |
63 | 63 | } |
64 | 64 | |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | ); |
81 | 81 | |
82 | 82 | $desc = p_get_metadata($ID, 'description', METADATA_RENDER_USING_SIMPLE_CACHE); |
83 | - if(!empty($desc)) { |
|
83 | + if (!empty($desc)) { |
|
84 | 84 | $desc = str_replace("\n", " ", $desc['abstract']); |
85 | 85 | $event->data['meta'][] = array( |
86 | 86 | 'name' => 'twitter:description', |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | ); |
89 | 89 | } |
90 | 90 | |
91 | - if($this->getConf('twitterUserName') !== '') { |
|
91 | + if ($this->getConf('twitterUserName') !== '') { |
|
92 | 92 | $event->data['meta'][] = array( |
93 | 93 | 'name' => 'twitter:creator', |
94 | 94 | 'content' => $this->getConf('twitterUserName'), |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | 'property' => 'og:title', |
136 | 136 | 'content' => p_get_metadata($ID, 'title', METADATA_RENDER_USING_SIMPLE_CACHE), |
137 | 137 | ); |
138 | - if(!empty($desc)) { |
|
138 | + if (!empty($desc)) { |
|
139 | 139 | $event->data['meta'][] = array( |
140 | 140 | 'property' => 'og:description', |
141 | 141 | 'content' => $desc, |
@@ -175,11 +175,11 @@ discard block |
||
175 | 175 | // 'content' => p_get_metadata($ID, 'user', METADATA_RENDER_USING_SIMPLE_CACHE), |
176 | 176 | // ); |
177 | 177 | $_subject = p_get_metadata($ID, 'subject', METADATA_RENDER_USING_SIMPLE_CACHE); |
178 | - if(!empty($_subject)) { |
|
179 | - if(!is_array($_subject)) { |
|
178 | + if (!empty($_subject)) { |
|
179 | + if (!is_array($_subject)) { |
|
180 | 180 | $_subject = array($_subject); |
181 | 181 | } |
182 | - foreach($_subject as $tag) { |
|
182 | + foreach ($_subject as $tag) { |
|
183 | 183 | $event->data['meta'][] = array( |
184 | 184 | 'property' => 'article:tag', |
185 | 185 | 'content' => $tag, |
@@ -189,10 +189,10 @@ discard block |
||
189 | 189 | |
190 | 190 | // place namespace http://ogp.me/ns/place# |
191 | 191 | $geotags = p_get_metadata($ID, 'geo', METADATA_RENDER_USING_SIMPLE_CACHE); |
192 | - if(is_array($geotags)) { |
|
192 | + if (is_array($geotags)) { |
|
193 | 193 | $lat = $geotags['lat'] ?? 0; |
194 | 194 | $lon = $geotags['lon'] ?? 0; |
195 | - if(!(empty($lat) && empty($lon))) { |
|
195 | + if (!(empty($lat) && empty($lon))) { |
|
196 | 196 | $event->data['meta'][] = array( |
197 | 197 | 'property' => 'place:location:latitude', |
198 | 198 | 'content' => $lat, |
@@ -204,9 +204,9 @@ discard block |
||
204 | 204 | } |
205 | 205 | // see https://developers.facebook.com/docs/opengraph/property-types/#geopoint |
206 | 206 | $alt = $geotags['alt'] ?? 0; |
207 | - if(!empty($alt)) { |
|
207 | + if (!empty($alt)) { |
|
208 | 208 | // facebook expects feet... |
209 | - $alt *= 3.2808; |
|
209 | + $alt *= 3.2808; |
|
210 | 210 | $event->data['meta'][] = array( |
211 | 211 | 'property' => 'place:location:altitude', |
212 | 212 | 'content' => $alt, |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | |
231 | 231 | // optional facebook app ID |
232 | 232 | $appId = $this->getConf('fbAppId'); |
233 | - if(!empty($appId)) { |
|
233 | + if (!empty($appId)) { |
|
234 | 234 | $event->data['meta'][] = array( |
235 | 235 | 'property' => 'fb:app_id', |
236 | 236 | 'content' => $appId, |
@@ -249,9 +249,9 @@ discard block |
||
249 | 249 | $rel = p_get_metadata($ID, 'relation', METADATA_RENDER_USING_SIMPLE_CACHE); |
250 | 250 | $img = $rel['firstimage']; |
251 | 251 | |
252 | - if(empty($img)) { |
|
252 | + if (empty($img)) { |
|
253 | 253 | $img = $this->getConf('fallbackImage'); |
254 | - if(strpos($img, "http") === 0) { |
|
254 | + if (strpos($img, "http") === 0) { |
|
255 | 255 | // don't use ml() as this results in a HTTP redirect after |
256 | 256 | // hitting the wiki making the card image fail. |
257 | 257 | return $img; |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | $imgID = $rel['firstimage']; |
274 | 274 | $alt = ""; |
275 | 275 | |
276 | - if(!empty($imgID)) { |
|
276 | + if (!empty($imgID)) { |
|
277 | 277 | require_once(DOKU_INC . 'inc/JpegMeta.php'); |
278 | 278 | $jpegmeta = new JpegMeta(mediaFN($imgID)); |
279 | 279 | $tags = array( |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | 'IPTC.Headline', |
285 | 285 | 'Xmp.dc:title' |
286 | 286 | ); |
287 | - $alt = media_getTag($tags, $jpegmeta, ""); |
|
287 | + $alt = media_getTag($tags, $jpegmeta, ""); |
|
288 | 288 | } |
289 | 289 | return htmlspecialchars($alt); |
290 | 290 | } |