Passed
Push — master ( a57385...45d23c )
by Mark
52s queued 13s
created
lib/sioc_inc.php 1 patch
Spacing   +267 added lines, -267 removed lines patch added patch discarded remove patch
@@ -105,36 +105,36 @@  discard block
 block discarded – undo
105 105
     }
106 106
 
107 107
     public function siocURL($type, $id, $page = "") {
108
-        $type_part = $this->url4type . $this->urlequal . $type;
108
+        $type_part = $this->url4type.$this->urlequal.$type;
109 109
 
110
-        if($id) {
111
-            if(isset($this->type_table[$type])) {
110
+        if ($id) {
111
+            if (isset($this->type_table[$type])) {
112 112
                             $myID = $this->type_table[$type];
113 113
             } else {
114
-                            $myID = (($this->url_usetype) ? $type . '_' : '') . $this->url4id;
114
+                            $myID = (($this->url_usetype) ? $type.'_' : '').$this->url4id;
115 115
             }
116 116
 
117
-            $id_part = $this->urlseparator . $myID . $this->urlequal . $id;
117
+            $id_part = $this->urlseparator.$myID.$this->urlequal.$id;
118 118
         } else {
119 119
             $id_part = '';
120 120
         }
121 121
 
122
-        ($page) ? $page_part = $this->urlseparator . $this->url4page . $this->urlequal . $page : $page_part = '';
122
+        ($page) ? $page_part = $this->urlseparator.$this->url4page.$this->urlequal.$page : $page_part = '';
123 123
 
124 124
         ($this->url_suffix && !isset($this->ignore_suffix[$type])) ? $suffix = $this->urlseparator
125 125
             . $this->url_suffix : $suffix = '';
126 126
 
127
-        $siocURL = $this->sioc_url . $type_part . $id_part . $page_part . $suffix;
127
+        $siocURL = $this->sioc_url.$type_part.$id_part.$page_part.$suffix;
128 128
         return clean($siocURL, true);
129 129
     }
130 130
 
131 131
     public function export($rdf_content = '') {
132
-        header('Content-Type: application/rdf+xml; charset=' . $this->encoding, true, 200);
132
+        header('Content-Type: application/rdf+xml; charset='.$this->encoding, true, 200);
133 133
         echo $this->makeRDF($rdf_content);
134 134
     }
135 135
 
136 136
     public function makeRDF($rdf_content = '') {
137
-        $rdf = '<?xml version="1.0" encoding="' . $this->encoding . '" ?>' . "\n";
137
+        $rdf = '<?xml version="1.0" encoding="'.$this->encoding.'" ?>'."\n";
138 138
         $rdf .= ' 
139 139
 <rdf:RDF
140 140
     xmlns="http://xmlns.com/foaf/0.1/"
@@ -149,18 +149,18 @@  discard block
 block discarded – undo
149 149
     xmlns:sioc="http://rdfs.org/sioc/ns#"
150 150
     xmlns:sioct="http://rdfs.org/sioc/types#"
151 151
     xmlns:owl="http://www.w3.org/2002/07/owl">
152
-<foaf:Document rdf:about="' . clean($this->profile_url, true) . '">
153
-	<dc:title>"' . clean($this->title) . '" (SIOC profile)</dc:title>
154
-	<foaf:primaryTopic rdf:resource="' . clean($this->objects[0]->_url, true) . '"/>
155
-	<admin:generatorAgent rdf:resource="' . clean($this->generator, true) . '"/>
156
-	<admin:generatorAgent rdf:resource="' . clean(EXPORTER_URL, true) . '?version=' . EXPORTER_VERSION . '"/>
152
+<foaf:Document rdf:about="' . clean($this->profile_url, true).'">
153
+	<dc:title>"' . clean($this->title).'" (SIOC profile)</dc:title>
154
+	<foaf:primaryTopic rdf:resource="' . clean($this->objects[0]->_url, true).'"/>
155
+	<admin:generatorAgent rdf:resource="' . clean($this->generator, true).'"/>
156
+	<admin:generatorAgent rdf:resource="' . clean(EXPORTER_URL, true).'?version='.EXPORTER_VERSION.'"/>
157 157
 </foaf:Document>' . "\n";
158
-        if($rdf_content) {
158
+        if ($rdf_content) {
159 159
             $rdf .= $rdf_content;
160 160
         }
161
-        if(count($this->objects)) {
162
-            foreach($this->objects as $object) {
163
-                if($object) {
161
+        if (count($this->objects)) {
162
+            foreach ($this->objects as $object) {
163
+                if ($object) {
164 164
                     $rdf .= $object->getContent($this);
165 165
                 }
166 166
             }
@@ -241,52 +241,52 @@  discard block
 block discarded – undo
241 241
     }
242 242
 
243 243
     public function getContent(&$exp): string {
244
-        $rdf = "<sioc:Site rdf:about=\"" . clean($this->url) . "\">\n";
245
-        $rdf .= "    <dc:title>" . clean($this->name) . "</dc:title>\n";
246
-        $rdf .= "    <dc:description>" . clean($this->description) . "</dc:description>\n";
247
-        $rdf .= "    <sioc:link rdf:resource=\"" . clean($this->url) . "\"/>\n";
248
-        if($this->forums) {
249
-            foreach($this->forums as $id => $url) {
250
-                $rdf .= "    <sioc:host_of rdf:resource=\"" . clean($url) . "\"/>\n";
244
+        $rdf = "<sioc:Site rdf:about=\"".clean($this->url)."\">\n";
245
+        $rdf .= "    <dc:title>".clean($this->name)."</dc:title>\n";
246
+        $rdf .= "    <dc:description>".clean($this->description)."</dc:description>\n";
247
+        $rdf .= "    <sioc:link rdf:resource=\"".clean($this->url)."\"/>\n";
248
+        if ($this->forums) {
249
+            foreach ($this->forums as $id => $url) {
250
+                $rdf .= "    <sioc:host_of rdf:resource=\"".clean($url)."\"/>\n";
251 251
             }
252 252
         }
253
-        if($this->next_forums) {
254
-            $rdf .= "    <rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('site', "", $this->page + 1) . "\"/>\n";
253
+        if ($this->next_forums) {
254
+            $rdf .= "    <rdfs:seeAlso rdf:resource=\"".$exp->siocURL('site', "", $this->page + 1)."\"/>\n";
255 255
         }
256
-        if($this->usergroup_uri) {
257
-            $rdf .= "    <sioc:has_Usergroup rdf:resource=\"" . $this->usergroup_uri . "\"/>\n";
256
+        if ($this->usergroup_uri) {
257
+            $rdf .= "    <sioc:has_Usergroup rdf:resource=\"".$this->usergroup_uri."\"/>\n";
258 258
         } else {
259
-            $rdf .= "    <sioc:has_Usergroup rdf:nodeID=\"" . AUTHORS_NODE . "\"/>\n";
259
+            $rdf .= "    <sioc:has_Usergroup rdf:nodeID=\"".AUTHORS_NODE."\"/>\n";
260 260
         }
261 261
         $rdf .= "</sioc:Site>\n";
262 262
         // Forums
263
-        if($this->forums) {
263
+        if ($this->forums) {
264 264
             $rdf .= "\n";
265
-            foreach($this->forums as $id => $url) {
266
-                $rdf .= '<sioc:Forum rdf:about="' . clean($url) . "\">\n";
267
-                $rdf .= "    <sioc:link rdf:resource=\"" . clean($url) . "\"/>\n";
268
-                $rdf .= "    <rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('forum', $id) . "\"/>\n";
265
+            foreach ($this->forums as $id => $url) {
266
+                $rdf .= '<sioc:Forum rdf:about="'.clean($url)."\">\n";
267
+                $rdf .= "    <sioc:link rdf:resource=\"".clean($url)."\"/>\n";
268
+                $rdf .= "    <rdfs:seeAlso rdf:resource=\"".$exp->siocURL('forum', $id)."\"/>\n";
269 269
                 $rdf .= "</sioc:Forum>\n";
270 270
             }
271 271
         }
272 272
         // Usergroup
273
-        if($this->users) {
273
+        if ($this->users) {
274 274
             $rdf .= "\n";
275
-            if($this->usergroup_uri) {
276
-                $rdf .= '<sioc:UserAccountgroup rdf:about="' . $this->usergroup_uri . "\">\n";
275
+            if ($this->usergroup_uri) {
276
+                $rdf .= '<sioc:UserAccountgroup rdf:about="'.$this->usergroup_uri."\">\n";
277 277
             } else {
278
-                $rdf .= '<sioc:UserAccountgroup rdf:nodeID="' . AUTHORS_NODE . "\">\n";
278
+                $rdf .= '<sioc:UserAccountgroup rdf:nodeID="'.AUTHORS_NODE."\">\n";
279 279
             }
280
-            $rdf .= "    <sioc:name>Authors for \"" . clean($this->name) . "\"</sioc:name>\n";
281
-            foreach($this->users as $id => $url) {
280
+            $rdf .= "    <sioc:name>Authors for \"".clean($this->name)."\"</sioc:name>\n";
281
+            foreach ($this->users as $id => $url) {
282 282
                 $rdf .= "    <sioc:has_member>\n";
283
-                $rdf .= "        <sioc:UserAccount rdf:about=\"" . clean($url) . "\">\n";
284
-                $rdf .= "            <rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('user', $id) . "\"/>\n";
283
+                $rdf .= "        <sioc:UserAccount rdf:about=\"".clean($url)."\">\n";
284
+                $rdf .= "            <rdfs:seeAlso rdf:resource=\"".$exp->siocURL('user', $id)."\"/>\n";
285 285
                 $rdf .= "        </sioc:UserAccount>\n";
286 286
                 $rdf .= "    </sioc:has_member>\n";
287 287
             }
288
-            if($this->next_users) {
289
-                $rdf .= "    <rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('site', "", $this->page + 1) . "\"/>\n";
288
+            if ($this->next_users) {
289
+                $rdf .= "    <rdfs:seeAlso rdf:resource=\"".$exp->siocURL('site', "", $this->page + 1)."\"/>\n";
290 290
             }
291 291
             $rdf .= "</sioc:UserAccountgroup>\n";
292 292
         }
@@ -334,13 +334,13 @@  discard block
 block discarded – undo
334 334
         $this->uri  = $uri;
335 335
         $this->name = $name;
336 336
 
337
-        if(preg_match_all('/^.+@.+\..+$/Ui', $email, $check, PREG_SET_ORDER)) {
338
-            if(preg_match_all('/^mailto:(.+@.+\..+$)/Ui', $email, $matches, PREG_SET_ORDER)) {
337
+        if (preg_match_all('/^.+@.+\..+$/Ui', $email, $check, PREG_SET_ORDER)) {
338
+            if (preg_match_all('/^mailto:(.+@.+\..+$)/Ui', $email, $matches, PREG_SET_ORDER)) {
339 339
                 $this->email = $email;
340 340
                 $this->sha1  = sha1($email);
341 341
             } else {
342
-                $this->email = "mailto:" . $email;
343
-                $this->sha1  = sha1("mailto:" . $email);
342
+                $this->email = "mailto:".$email;
343
+                $this->sha1  = sha1("mailto:".$email);
344 344
             }
345 345
         }
346 346
         $this->homepage = $homepage;
@@ -353,36 +353,36 @@  discard block
 block discarded – undo
353 353
     }
354 354
 
355 355
     public function getContent(&$exp): string {
356
-        $rdf = "<foaf:Person rdf:about=\"" . clean($this->foaf_uri) . "\">\n";
357
-        if($this->name) {
358
-            $rdf .= "    <foaf:name>" . $this->name . "</foaf:name>\n";
356
+        $rdf = "<foaf:Person rdf:about=\"".clean($this->foaf_uri)."\">\n";
357
+        if ($this->name) {
358
+            $rdf .= "    <foaf:name>".$this->name."</foaf:name>\n";
359 359
         }
360
-        if($this->email) {
361
-            $rdf .= "    <foaf:mbox_sha1sum>" . $this->sha1 . "</foaf:mbox_sha1sum>\n";
360
+        if ($this->email) {
361
+            $rdf .= "    <foaf:mbox_sha1sum>".$this->sha1."</foaf:mbox_sha1sum>\n";
362 362
         }
363
-        if($this->foaf_url) {
364
-            $rdf .= "    <rdfs:seeAlso rdf:resource=\"" . $this->foaf_url . "\"/>\n";
363
+        if ($this->foaf_url) {
364
+            $rdf .= "    <rdfs:seeAlso rdf:resource=\"".$this->foaf_url."\"/>\n";
365 365
         }
366 366
         $rdf .= "    <foaf:holdsAccount>\n";
367
-        $rdf .= "        <sioc:UserAccount rdf:about=\"" . clean($this->uri) . "\">\n";
368
-        if($this->nick) {
369
-            $rdf .= "            <sioc:name>" . $this->nick . "</sioc:name>\n";
367
+        $rdf .= "        <sioc:UserAccount rdf:about=\"".clean($this->uri)."\">\n";
368
+        if ($this->nick) {
369
+            $rdf .= "            <sioc:name>".$this->nick."</sioc:name>\n";
370 370
         }
371
-        if($this->email) {
372
-            if($exp->_export_email) {
373
-                $rdf .= "            <sioc:email rdf:resource=\"" . $this->email . "\"/>\n";
371
+        if ($this->email) {
372
+            if ($exp->_export_email) {
373
+                $rdf .= "            <sioc:email rdf:resource=\"".$this->email."\"/>\n";
374 374
             }
375
-            $rdf .= "            <sioc:email_sha1>" . $this->sha1 . "</sioc:email_sha1>\n";
375
+            $rdf .= "            <sioc:email_sha1>".$this->sha1."</sioc:email_sha1>\n";
376 376
         }
377
-        if($this->role) {
377
+        if ($this->role) {
378 378
             $rdf .= "            <sioc:has_function>\n";
379 379
             $rdf .= "                <sioc:Role>\n";
380
-            $rdf .= "                    <sioc:name>" . $this->role . "</sioc:name>\n";
380
+            $rdf .= "                    <sioc:name>".$this->role."</sioc:name>\n";
381 381
             $rdf .= "                </sioc:Role>\n";
382 382
             $rdf .= "            </sioc:has_function>\n";
383 383
         }
384
-        if($this->sioc_url) {
385
-            $rdf .= "            <rdfs:seeAlso rdf:resource=\"" . $this->sioc_url . "\"/>\n";
384
+        if ($this->sioc_url) {
385
+            $rdf .= "            <rdfs:seeAlso rdf:resource=\"".$this->sioc_url."\"/>\n";
386 386
         }
387 387
         $rdf .= "        </sioc:UserAccount>\n";
388 388
         $rdf .= "    </foaf:holdsAccount>\n";
@@ -449,33 +449,33 @@  discard block
 block discarded – undo
449 449
     }
450 450
 
451 451
     public function getContent(&$exp): string {
452
-        $rdf = '<sioc:Thread rdf:about="' . clean($this->url) . "\">\n";
453
-        $rdf .= "    <sioc:link rdf:resource=\"" . clean($this->url) . "\"/>\n";
454
-        if($this->views) {
455
-          $rdf .= "    <sioc:num_views>" . $this->views . "</sioc:num_views>\n";
452
+        $rdf = '<sioc:Thread rdf:about="'.clean($this->url)."\">\n";
453
+        $rdf .= "    <sioc:link rdf:resource=\"".clean($this->url)."\"/>\n";
454
+        if ($this->views) {
455
+          $rdf .= "    <sioc:num_views>".$this->views."</sioc:num_views>\n";
456 456
         }
457
-        if($this->note) {
458
-          $rdf .= "    <rdfs:comment>" . $this->note . "</rdfs:comment>\n";
457
+        if ($this->note) {
458
+          $rdf .= "    <rdfs:comment>".$this->note."</rdfs:comment>\n";
459 459
         }
460
-        if($this->subject) {
461
-            $rdf .= "    <dc:title>" . $this->subject . "</dc:title>\n";
460
+        if ($this->subject) {
461
+            $rdf .= "    <dc:title>".$this->subject."</dc:title>\n";
462 462
         }
463
-        if($this->created) {
464
-            $rdf .= "    <dcterms:created>" . $this->created . "</dcterms:created>\n";
463
+        if ($this->created) {
464
+            $rdf .= "    <dcterms:created>".$this->created."</dcterms:created>\n";
465 465
         }
466
-        if($this->parents) {
467
-            foreach($this->parents as $id => $uri) {
466
+        if ($this->parents) {
467
+            foreach ($this->parents as $id => $uri) {
468 468
                 $rdf .= "    <sioc:has_parent>\n";
469
-                $rdf .= "        <sioc:Forum rdf:about=\"" . clean($uri) . "\">\n";
470
-                $rdf .= "            <rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('forum', $id) . "\"/>\n";
469
+                $rdf .= "        <sioc:Forum rdf:about=\"".clean($uri)."\">\n";
470
+                $rdf .= "            <rdfs:seeAlso rdf:resource=\"".$exp->siocURL('forum', $id)."\"/>\n";
471 471
                 $rdf .= "        </sioc:Forum>\n";
472 472
                 $rdf .= "    </sioc:has_parent>\n";
473 473
             }
474 474
         }
475 475
         // here the tags are just used as keywords for dc:subject
476
-        if($this->tags) {
477
-            foreach($this->tags as $id => $tag) {
478
-                $rdf .= "    <dc:subject>" . $tag . "</dc:subject>\n";
476
+        if ($this->tags) {
477
+            foreach ($this->tags as $id => $tag) {
478
+                $rdf .= "    <dc:subject>".$tag."</dc:subject>\n";
479 479
             }
480 480
         }
481 481
         // here the tags are used by creating a tag object with a blank node, with the keyword as moat:name - if you
@@ -501,31 +501,31 @@  discard block
 block discarded – undo
501 501
                 }
502 502
             }
503 503
             */
504
-        if($this->related) {
505
-            foreach($this->related as $id => $url) {
504
+        if ($this->related) {
505
+            foreach ($this->related as $id => $url) {
506 506
                 $rdf .= "    <sioc:related_to>\n";
507
-                $rdf .= "        <sioc:Thread rdf:about=\"" . clean($url) . "\"/>\n";
507
+                $rdf .= "        <sioc:Thread rdf:about=\"".clean($url)."\"/>\n";
508 508
                 $rdf .= "    </sioc:related_to>\n"; // todo - each topic needs to have a URI
509 509
             }
510 510
         }
511 511
 
512
-        if($this->posts) {
513
-            foreach($this->posts as $id => $data) {
512
+        if ($this->posts) {
513
+            foreach ($this->posts as $id => $data) {
514 514
                 $rdf .= "    <sioc:container_of>\n";
515
-                $rdf .= "        <sioc:Post rdf:about=\"" . clean($data[url]) . "\">\n";
516
-                $rdf .= "            <rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('post', $id) . "\"/>\n";
517
-                if($data[prev]) {
518
-                    $rdf .= "            <sioc:previous_by_date rdf:resource=\"" . clean($data[prev]) . "\"/>\n";
515
+                $rdf .= "        <sioc:Post rdf:about=\"".clean($data[url])."\">\n";
516
+                $rdf .= "            <rdfs:seeAlso rdf:resource=\"".$exp->siocURL('post', $id)."\"/>\n";
517
+                if ($data[prev]) {
518
+                    $rdf .= "            <sioc:previous_by_date rdf:resource=\"".clean($data[prev])."\"/>\n";
519 519
                 }
520
-                if($data[next]) {
521
-                    $rdf .= "            <sioc:next_by_date rdf:resource=\"" . clean($data[next]) . "\"/>\n";
520
+                if ($data[next]) {
521
+                    $rdf .= "            <sioc:next_by_date rdf:resource=\"".clean($data[next])."\"/>\n";
522 522
                 }
523 523
                 $rdf .= "        </sioc:Post>\n";
524 524
                 $rdf .= "    </sioc:container_of>\n";
525 525
             }
526 526
         }
527
-        if($this->next) {
528
-            $rdf .= "\r<rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('thread', $this->id, $this->page + 1)
527
+        if ($this->next) {
528
+            $rdf .= "\r<rdfs:seeAlso rdf:resource=\"".$exp->siocURL('thread', $this->id, $this->page + 1)
529 529
                 . "\"/>\n";
530 530
         }
531 531
         $rdf .= "</sioc:Thread>\n";
@@ -605,69 +605,69 @@  discard block
 block discarded – undo
605 605
     }
606 606
 
607 607
     public function getContent(&$exp): string {
608
-        $rdf = '<' . $this->_type . ' rdf:about="' . clean($this->url) . "\">\n";
609
-        if($this->_type != 'sioc:Forum') {
608
+        $rdf = '<'.$this->_type.' rdf:about="'.clean($this->url)."\">\n";
609
+        if ($this->_type != 'sioc:Forum') {
610 610
           $rdf .= "    <rdf:type rdf:resource=\"http://rdfs.org/sioc/ns#Forum\" />\n";
611 611
         }
612
-        $rdf .= "    <sioc:link rdf:resource=\"" . clean($this->url) . "\"/>\n";
613
-        if($this->blog_title) {
614
-          $rdf .= "    <dc:title>" . $this->blog_title . "</dc:title>\n";
612
+        $rdf .= "    <sioc:link rdf:resource=\"".clean($this->url)."\"/>\n";
613
+        if ($this->blog_title) {
614
+          $rdf .= "    <dc:title>".$this->blog_title."</dc:title>\n";
615 615
         }
616
-        if($this->description) {
617
-          $rdf .= "    <dc:description>" . $this->description . "</dc:description>\n";
616
+        if ($this->description) {
617
+          $rdf .= "    <dc:description>".$this->description."</dc:description>\n";
618 618
         }
619
-        if($this->note) {
620
-          $rdf .= "    <rdfs:comment>" . $this->note . "</rdfs:comment>\n";
619
+        if ($this->note) {
620
+          $rdf .= "    <rdfs:comment>".$this->note."</rdfs:comment>\n";
621 621
         }
622 622
 
623
-        if($this->parents) {
624
-            foreach($this->parents as $id => $uri) {
623
+        if ($this->parents) {
624
+            foreach ($this->parents as $id => $uri) {
625 625
                 $rdf .= "    <sioc:has_parent>\n";
626
-                $rdf .= "        <sioc:Forum rdf:about=\"" . clean($uri) . "\">\n";
627
-                $rdf .= "            <rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('forum', $id) . "\"/>\n";
626
+                $rdf .= "        <sioc:Forum rdf:about=\"".clean($uri)."\">\n";
627
+                $rdf .= "            <rdfs:seeAlso rdf:resource=\"".$exp->siocURL('forum', $id)."\"/>\n";
628 628
                 $rdf .= "        </sioc:Forum>\n";
629 629
                 $rdf .= "    </sioc:has_parent>\n";
630 630
             }
631 631
         }
632 632
 
633
-        if($this->threads) {
634
-            foreach($this->threads as $id => $uri) {
633
+        if ($this->threads) {
634
+            foreach ($this->threads as $id => $uri) {
635 635
                 $rdf .= "    <sioc:parent_of>\n";
636
-                $rdf .= "        <sioc:Thread rdf:about=\"" . clean($uri) . "\">\n";
637
-                $rdf .= "            <rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('thread', $id) . "\"/>\n";
636
+                $rdf .= "        <sioc:Thread rdf:about=\"".clean($uri)."\">\n";
637
+                $rdf .= "            <rdfs:seeAlso rdf:resource=\"".$exp->siocURL('thread', $id)."\"/>\n";
638 638
                 $rdf .= "        </sioc:Thread>\n";
639 639
                 $rdf .= "    </sioc:parent_of>\n";
640 640
             }
641 641
         }
642 642
 
643
-        if($this->posts) {
644
-            foreach($this->posts as $id => $url) {
643
+        if ($this->posts) {
644
+            foreach ($this->posts as $id => $url) {
645 645
                 $rdf .= "    <sioc:container_of>\n";
646
-                $rdf .= "        <sioc:Post rdf:about=\"" . clean($url) . "\">\n";
647
-                $rdf .= "            <rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('post', $id) . "\"/>\n";
646
+                $rdf .= "        <sioc:Post rdf:about=\"".clean($url)."\">\n";
647
+                $rdf .= "            <rdfs:seeAlso rdf:resource=\"".$exp->siocURL('post', $id)."\"/>\n";
648 648
                 $rdf .= "        </sioc:Post>\n";
649 649
                 $rdf .= "    </sioc:container_of>\n";
650 650
             }
651 651
         }
652 652
 
653
-        if($this->creator) {
654
-            if($this->creator->_id) {
653
+        if ($this->creator) {
654
+            if ($this->creator->_id) {
655 655
                 $rdf .= "    <sioc:has_creator>\n";
656
-                $rdf .= "        <sioc:UserAccount rdf:about=\"" . clean($this->creator->_uri) . "\">\n";
657
-                if($this->creator->_sioc_url) {
658
-                    $rdf .= "            <rdfs:seeAlso rdf:resource=\"" . $this->creator->_sioc_url . "\"/>\n";
656
+                $rdf .= "        <sioc:UserAccount rdf:about=\"".clean($this->creator->_uri)."\">\n";
657
+                if ($this->creator->_sioc_url) {
658
+                    $rdf .= "            <rdfs:seeAlso rdf:resource=\"".$this->creator->_sioc_url."\"/>\n";
659 659
                 } else {
660
-                    $rdf .= "            <rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('user', $this->creator->_id)
660
+                    $rdf .= "            <rdfs:seeAlso rdf:resource=\"".$exp->siocURL('user', $this->creator->_id)
661 661
                         . "\"/>\n";
662 662
                 }
663 663
                 $rdf .= "        </sioc:UserAccount>\n";
664 664
                 $rdf .= "    </sioc:has_creator>\n";
665 665
                 $rdf .= "    <foaf:maker>\n";
666
-                $rdf .= "        <foaf:Person rdf:about=\"" . clean($this->creator->_foaf_uri) . "\">\n";
667
-                if($this->creator->_foaf_url) {
668
-                    $rdf .= "            <rdfs:seeAlso rdf:resource=\"" . $this->creator->_foaf_url . "\"/>\n";
666
+                $rdf .= "        <foaf:Person rdf:about=\"".clean($this->creator->_foaf_uri)."\">\n";
667
+                if ($this->creator->_foaf_url) {
668
+                    $rdf .= "            <rdfs:seeAlso rdf:resource=\"".$this->creator->_foaf_url."\"/>\n";
669 669
                 } else {
670
-                    $rdf .= "            <rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('user', $this->creator->_id)
670
+                    $rdf .= "            <rdfs:seeAlso rdf:resource=\"".$exp->siocURL('user', $this->creator->_id)
671 671
                         . "\"/>\n";
672 672
                 }
673 673
                 $rdf .= "        </foaf:Person>\n";
@@ -675,14 +675,14 @@  discard block
 block discarded – undo
675 675
             } else {
676 676
                 $rdf .= "    <foaf:maker>\n";
677 677
                 $rdf .= "        <foaf:Person";
678
-                if($this->creator->_name) {
679
-                    $rdf .= " foaf:name=\"" . $this->creator->_name . "\"";
678
+                if ($this->creator->_name) {
679
+                    $rdf .= " foaf:name=\"".$this->creator->_name."\"";
680 680
                 }
681
-                if($this->creator->_sha1) {
682
-                    $rdf .= " foaf:mbox_sha1sum=\"" . $this->creator->_sha1 . "\"";
681
+                if ($this->creator->_sha1) {
682
+                    $rdf .= " foaf:mbox_sha1sum=\"".$this->creator->_sha1."\"";
683 683
                 }
684
-                if($this->creator->_name) {
685
-                    $rdf .= ">\n            <foaf:homepage rdf:resource=\"" . $this->creator->_homepage
684
+                if ($this->creator->_name) {
685
+                    $rdf .= ">\n            <foaf:homepage rdf:resource=\"".$this->creator->_homepage
686 686
                         . "\"/>\n        </foaf:Person>\n";
687 687
                 } else {
688 688
                     $rdf .= "/>\n";
@@ -691,30 +691,30 @@  discard block
 block discarded – undo
691 691
             }
692 692
         }
693 693
 
694
-        if($this->administrator) {
695
-            if($this->administrator->_id) {
694
+        if ($this->administrator) {
695
+            if ($this->administrator->_id) {
696 696
                 $rdf .= "    <sioc:has_administrator>\n";
697
-                $rdf .= "        <sioc:UserAccount rdf:about=\"" . clean($this->administrator->_uri) . "\">\n";
698
-                if($this->administrator->_sioc_url) {
699
-                    $rdf .= "            <rdfs:seeAlso rdf:resource=\"" . $this->administrator->_sioc_url . "\"/>\n";
697
+                $rdf .= "        <sioc:UserAccount rdf:about=\"".clean($this->administrator->_uri)."\">\n";
698
+                if ($this->administrator->_sioc_url) {
699
+                    $rdf .= "            <rdfs:seeAlso rdf:resource=\"".$this->administrator->_sioc_url."\"/>\n";
700 700
                 } else {
701 701
                   $rdf .= "            <rdfs:seeAlso rdf:resource=\""
702
-                                                        . $exp->siocURL('user', $this->administrator->_id) . "\"/>\n";
702
+                                                        . $exp->siocURL('user', $this->administrator->_id)."\"/>\n";
703 703
                 }
704 704
                 $rdf .= "        </sioc:UserAccount>\n";
705 705
                 $rdf .= "    </sioc:has_administrator>\n";
706 706
             }
707 707
         }
708
-        if($this->links) {
709
-            foreach($this->links as $url => $link) {
710
-                $rdf .= "    <sioc:links_to rdfs:label=\"$link\" rdf:resource=\"" . clean($url) . "\"/>\n";
708
+        if ($this->links) {
709
+            foreach ($this->links as $url => $link) {
710
+                $rdf .= "    <sioc:links_to rdfs:label=\"$link\" rdf:resource=\"".clean($url)."\"/>\n";
711 711
             }
712 712
         }
713 713
 
714
-        if($this->next) {
715
-            $rdf .= "\r<rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('forum', $this->id, $this->page + 1) . "\"/>\n";
714
+        if ($this->next) {
715
+            $rdf .= "\r<rdfs:seeAlso rdf:resource=\"".$exp->siocURL('forum', $this->id, $this->page + 1)."\"/>\n";
716 716
         }
717
-        $rdf .= "</" . $this->_type . ">";
717
+        $rdf .= "</".$this->_type.">";
718 718
 
719 719
         return $rdf;
720 720
     }
@@ -779,31 +779,31 @@  discard block
 block discarded – undo
779 779
     }
780 780
 
781 781
     public function getContent(&$exp): string {
782
-        $rdf = '<' . $this->_type . " rdf:about=\"" . clean($this->url) . "\">\n";
783
-        if($this->_type != 'sioc:Post') {
782
+        $rdf = '<'.$this->_type." rdf:about=\"".clean($this->url)."\">\n";
783
+        if ($this->_type != 'sioc:Post') {
784 784
           $rdf .= "    <rdf:type rdf:resource=\"http://rdfs.org/sioc/ns#Post\" />\n";
785 785
         }
786
-        if($this->subject) {
787
-            $rdf .= "    <dc:title>" . $this->subject . "</dc:title>\n";
786
+        if ($this->subject) {
787
+            $rdf .= "    <dc:title>".$this->subject."</dc:title>\n";
788 788
         }
789
-        if($this->creator) {
790
-            if($this->creator->_id) {
789
+        if ($this->creator) {
790
+            if ($this->creator->_id) {
791 791
                 $rdf .= "    <sioc:has_creator>\n";
792
-                $rdf .= "        <sioc:UserAccount rdf:about=\"" . clean($this->creator->_uri) . "\">\n";
793
-                if($this->creator->_sioc_url) {
794
-                    $rdf .= "            <rdfs:seeAlso rdf:resource=\"" . $this->creator->_sioc_url . "\"/>\n";
792
+                $rdf .= "        <sioc:UserAccount rdf:about=\"".clean($this->creator->_uri)."\">\n";
793
+                if ($this->creator->_sioc_url) {
794
+                    $rdf .= "            <rdfs:seeAlso rdf:resource=\"".$this->creator->_sioc_url."\"/>\n";
795 795
                 } else {
796
-                    $rdf .= "            <rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('user', $this->creator->_id)
796
+                    $rdf .= "            <rdfs:seeAlso rdf:resource=\"".$exp->siocURL('user', $this->creator->_id)
797 797
                         . "\"/>\n";
798 798
                 }
799 799
                 $rdf .= "        </sioc:UserAccount>\n";
800 800
                 $rdf .= "    </sioc:has_creator>\n";
801 801
                 $rdf .= "    <foaf:maker>\n";
802
-                $rdf .= "        <foaf:Person rdf:about=\"" . clean($this->creator->_foaf_uri) . "\">\n";
803
-                if($this->creator->_foaf_url) {
804
-                    $rdf .= "            <rdfs:seeAlso rdf:resource=\"" . $this->creator->_foaf_url . "\"/>\n";
802
+                $rdf .= "        <foaf:Person rdf:about=\"".clean($this->creator->_foaf_uri)."\">\n";
803
+                if ($this->creator->_foaf_url) {
804
+                    $rdf .= "            <rdfs:seeAlso rdf:resource=\"".$this->creator->_foaf_url."\"/>\n";
805 805
                 } else {
806
-                    $rdf .= "            <rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('user', $this->creator->_id)
806
+                    $rdf .= "            <rdfs:seeAlso rdf:resource=\"".$exp->siocURL('user', $this->creator->_id)
807 807
                         . "\"/>\n";
808 808
                 }
809 809
                 $rdf .= "        </foaf:Person>\n";
@@ -811,14 +811,14 @@  discard block
 block discarded – undo
811 811
             } else {
812 812
                 $rdf .= "    <foaf:maker>\n";
813 813
                 $rdf .= "        <foaf:Person";
814
-                if($this->creator->_name) {
815
-                    $rdf .= " foaf:name=\"" . $this->creator->_name . "\"";
814
+                if ($this->creator->_name) {
815
+                    $rdf .= " foaf:name=\"".$this->creator->_name."\"";
816 816
                 }
817
-                if($this->creator->_sha1) {
818
-                    $rdf .= " foaf:mbox_sha1sum=\"" . $this->creator->_sha1 . "\"";
817
+                if ($this->creator->_sha1) {
818
+                    $rdf .= " foaf:mbox_sha1sum=\"".$this->creator->_sha1."\"";
819 819
                 }
820
-                if($this->creator->_name) {
821
-                    $rdf .= ">\n            <foaf:homepage rdf:resource=\"" . $this->creator->_homepage
820
+                if ($this->creator->_name) {
821
+                    $rdf .= ">\n            <foaf:homepage rdf:resource=\"".$this->creator->_homepage
822 822
                         . "\"/>\n        </foaf:Person>\n";
823 823
                 } else {
824 824
                     $rdf .= "/>\n";
@@ -826,53 +826,53 @@  discard block
 block discarded – undo
826 826
                 $rdf .= "    </foaf:maker>\n";
827 827
             }
828 828
         }
829
-        $rdf .= "    <dcterms:created>" . $this->created . "</dcterms:created>\n";
830
-        if($this->updated and ($this->created != $this->updated)) {
829
+        $rdf .= "    <dcterms:created>".$this->created."</dcterms:created>\n";
830
+        if ($this->updated and ($this->created != $this->updated)) {
831 831
           $rdf .= "    <dcterms:modified>"
832
-            . $this->updated . "</dcterms:modified>\n";
832
+            . $this->updated."</dcterms:modified>\n";
833 833
         }
834
-        $rdf .= "    <sioc:content>" . pureContent($this->content) . "</sioc:content>\n";
834
+        $rdf .= "    <sioc:content>".pureContent($this->content)."</sioc:content>\n";
835 835
 
836
-        $rdf .= "    <content:encoded><![CDATA[" . $this->encoded . "]]></content:encoded>\n";
837
-        if($this->topics) {
838
-            foreach($this->topics as $url => $topic) {
839
-                $rdf .= "    <sioc:topic rdfs:label=\"$topic\" rdf:resource=\"" . clean($url) . "\"/>\n";
836
+        $rdf .= "    <content:encoded><![CDATA[".$this->encoded."]]></content:encoded>\n";
837
+        if ($this->topics) {
838
+            foreach ($this->topics as $url => $topic) {
839
+                $rdf .= "    <sioc:topic rdfs:label=\"$topic\" rdf:resource=\"".clean($url)."\"/>\n";
840 840
             }
841 841
         }
842
-        if($this->links) {
843
-            foreach($this->links as $url => $link) {
844
-                $rdf .= "    <sioc:links_to rdfs:label=\"$link\" rdf:resource=\"" . clean($url) . "\"/>\n";
842
+        if ($this->links) {
843
+            foreach ($this->links as $url => $link) {
844
+                $rdf .= "    <sioc:links_to rdfs:label=\"$link\" rdf:resource=\"".clean($url)."\"/>\n";
845 845
             }
846 846
         }
847
-        if($this->has_part) {
848
-            foreach($this->has_part as $id => $url) {
847
+        if ($this->has_part) {
848
+            foreach ($this->has_part as $id => $url) {
849 849
                 $rdf .= "    <dcterms:hasPart>\n";
850
-                $rdf .= "        <dcmitype:Image rdf:about=\"" . clean($url) . "\"/>\n";
850
+                $rdf .= "        <dcmitype:Image rdf:about=\"".clean($url)."\"/>\n";
851 851
                 $rdf .= "    </dcterms:hasPart>\n";
852 852
             }
853 853
         }
854
-        if($this->reply_of) {
855
-            foreach($this->reply_of as $id => $url) {
854
+        if ($this->reply_of) {
855
+            foreach ($this->reply_of as $id => $url) {
856 856
                 $rdf .= "    <sioc:reply_of>\n";
857
-                $rdf .= "        <sioc:Post rdf:about=\"" . clean($url) . "\">\n";
858
-                $rdf .= "            <rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('post', $id) . "\"/>\n";
857
+                $rdf .= "        <sioc:Post rdf:about=\"".clean($url)."\">\n";
858
+                $rdf .= "            <rdfs:seeAlso rdf:resource=\"".$exp->siocURL('post', $id)."\"/>\n";
859 859
                 $rdf .= "        </sioc:Post>\n";
860 860
                 $rdf .= "    </sioc:reply_of>\n";
861 861
             }
862 862
         }
863
-        if($this->comments) {
864
-            foreach($this->comments as $id => $url) {
863
+        if ($this->comments) {
864
+            foreach ($this->comments as $id => $url) {
865 865
                 $rdf .= "    <sioc:has_reply>\n";
866
-                $rdf .= "        <sioc:Post rdf:about=\"" . clean($url) . "\">\n";
866
+                $rdf .= "        <sioc:Post rdf:about=\"".clean($url)."\">\n";
867 867
                 //        if($comments->f('comment_trackback')) $rdf .= "            <sioc:type>"
868 868
                 // . POST_TRACKBACK . "</sioc:type>\n";
869 869
                 //        else $rdf .= "            <sioc:type>" . POST_COMMENT  . "</sioc:type>\n";
870
-                $rdf .= "            <rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('comment', $id) . "\"/>\n";
870
+                $rdf .= "            <rdfs:seeAlso rdf:resource=\"".$exp->siocURL('comment', $id)."\"/>\n";
871 871
                 $rdf .= "        </sioc:Post>\n";
872 872
                 $rdf .= "    </sioc:has_reply>\n";
873 873
             }
874 874
         }
875
-        $rdf .= "</" . $this->_type . ">\n";
875
+        $rdf .= "</".$this->_type.">\n";
876 876
         return $rdf;
877 877
     }
878 878
 }
@@ -936,17 +936,17 @@  discard block
 block discarded – undo
936 936
     }
937 937
 
938 938
     public function getContent(&$exp): string {
939
-        $rdf = '<' . $this->_type . " rdf:about=\"" . clean($this->url) . "\">\n";
940
-        if($this->subject) {
941
-            $rdf .= "    <dc:title>" . clean($this->subject) . "</dc:title>\n";
942
-            if(strcmp($this->has_container, 'http://en.wikipedia.org') === 0) {
943
-                $rdf .= "    <foaf:primaryTopic rdf:resource=\"" . clean(
939
+        $rdf = '<'.$this->_type." rdf:about=\"".clean($this->url)."\">\n";
940
+        if ($this->subject) {
941
+            $rdf .= "    <dc:title>".clean($this->subject)."</dc:title>\n";
942
+            if (strcmp($this->has_container, 'http://en.wikipedia.org') === 0) {
943
+                $rdf .= "    <foaf:primaryTopic rdf:resource=\"".clean(
944 944
                         'http://dbpedia.org/resource/'
945 945
                         . $this->subject
946
-                    ) . "\"/>\n";
946
+                    )."\"/>\n";
947 947
             }
948 948
         }
949
-        if($this->creator->_nick) {
949
+        if ($this->creator->_nick) {
950 950
             /*if ($this->creator->id) {
951 951
                 $rdf .= "    <sioc:has_creator>\n";
952 952
                 $rdf .= "        <sioc:UserAccount rdf:about=\"" . clean($this->creator->uri) ."\">\n";
@@ -966,16 +966,16 @@  discard block
 block discarded – undo
966 966
                 $rdf .= "    </foaf:maker>\n";
967 967
             } else {*/
968 968
             $rdf .= "    <sioc:has_creator>\n";
969
-            $rdf .= "        <sioc:UserAccount rdf:about=\"" . clean($this->creator->_uri) . "\">\n";
970
-            $rdf .= "            <rdfs:seeAlso rdf:resource=\"" .
971
-                clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki=' . $this->creator->_uri);
972
-            if($this->api) {
973
-                $rdf .= clean("&api=" . $this->api);
969
+            $rdf .= "        <sioc:UserAccount rdf:about=\"".clean($this->creator->_uri)."\">\n";
970
+            $rdf .= "            <rdfs:seeAlso rdf:resource=\"".
971
+                clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki='.$this->creator->_uri);
972
+            if ($this->api) {
973
+                $rdf .= clean("&api=".$this->api);
974 974
             }
975 975
             $rdf .= "\"/>\n";
976 976
             $rdf .= "        </sioc:UserAccount>\n";
977 977
             $rdf .= "    </sioc:has_creator>\n";
978
-            $rdf .= "    <dc:contributor>" . clean($this->creator->_nick) . "</dc:contributor>\n";
978
+            $rdf .= "    <dc:contributor>".clean($this->creator->_nick)."</dc:contributor>\n";
979 979
             /*$rdf .= "    <foaf:maker>\n";
980 980
             $rdf .= "        <foaf:Person";
981 981
             if($this->creator->name) $rdf .= " foaf:name=\"" . $this->creator->name ."\"";
@@ -986,69 +986,69 @@  discard block
 block discarded – undo
986 986
             $rdf .= "    </foaf:maker>\n";
987 987
         }*/
988 988
         } else {
989
-            if($this->creator !== 'void') {
989
+            if ($this->creator !== 'void') {
990 990
                 $rdf .= "    <sioc:has_creator>\n";
991 991
                 $rdf .= "        <sioc:UserAccount>\n";
992 992
                 $rdf .= "        </sioc:UserAccount>\n";
993 993
                 $rdf .= "    </sioc:has_creator>\n";
994 994
             }
995 995
         }
996
-        if($this->created) {
997
-            $rdf .= "    <dcterms:created>" . $this->created . "</dcterms:created>\n";
996
+        if ($this->created) {
997
+            $rdf .= "    <dcterms:created>".$this->created."</dcterms:created>\n";
998 998
         }
999
-        if(is_array($this->topics)) {
1000
-            foreach($this->topics as $topic => $url) {
999
+        if (is_array($this->topics)) {
1000
+            foreach ($this->topics as $topic => $url) {
1001 1001
                 $rdf .= "    <sioc:topic>\n";
1002
-                $rdf .= "        <sioct:Category rdf:about=\"" . clean($url) . "\">\n";
1003
-                $rdf .= "            <rdfs:seeAlso rdf:resource=\"" .
1004
-                    clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki=' . $url);
1005
-                if($this->api) {
1006
-                    $rdf .= clean("&api=" . $this->api);
1002
+                $rdf .= "        <sioct:Category rdf:about=\"".clean($url)."\">\n";
1003
+                $rdf .= "            <rdfs:seeAlso rdf:resource=\"".
1004
+                    clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki='.$url);
1005
+                if ($this->api) {
1006
+                    $rdf .= clean("&api=".$this->api);
1007 1007
                 }
1008 1008
                 $rdf .= "\"/>\n";
1009 1009
                 $rdf .= "        </sioct:Category>\n";
1010 1010
                 $rdf .= "    </sioc:topic>\n";
1011 1011
             }
1012 1012
         }
1013
-        if(is_array($this->links)) {
1014
-            foreach($this->links as $label => $url) {
1013
+        if (is_array($this->links)) {
1014
+            foreach ($this->links as $label => $url) {
1015 1015
                 $rdf .= "    <sioc:links_to>\n";
1016
-                $rdf .= "        <sioct:WikiArticle rdf:about=\"" . clean($url) . "\">\n";
1017
-                $rdf .= "            <rdfs:seeAlso rdf:resource=\"" .
1018
-                    clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki=' . $url);
1019
-                if($this->api) {
1020
-                    $rdf .= clean("&api=" . $this->api);
1016
+                $rdf .= "        <sioct:WikiArticle rdf:about=\"".clean($url)."\">\n";
1017
+                $rdf .= "            <rdfs:seeAlso rdf:resource=\"".
1018
+                    clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki='.$url);
1019
+                if ($this->api) {
1020
+                    $rdf .= clean("&api=".$this->api);
1021 1021
                 }
1022 1022
                 $rdf .= "\"/>\n";
1023 1023
                 $rdf .= "        </sioct:WikiArticle>\n";
1024 1024
                 $rdf .= "    </sioc:links_to>\n";
1025 1025
             }
1026 1026
         } else {
1027
-            if($this->links) {
1027
+            if ($this->links) {
1028 1028
                 $rdf .= "    <sioc:links_to>\n";
1029
-                $rdf .= "        <sioct:WikiArticle rdf:about=\"" . clean($this->links) . "\">\n";
1030
-                $rdf .= "            <rdfs:seeAlso rdf:resource=\"" .
1031
-                    clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki=' . $this->links);
1032
-                if($this->api) {
1033
-                    $rdf .= clean("&api=" . $this->api);
1029
+                $rdf .= "        <sioct:WikiArticle rdf:about=\"".clean($this->links)."\">\n";
1030
+                $rdf .= "            <rdfs:seeAlso rdf:resource=\"".
1031
+                    clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki='.$this->links);
1032
+                if ($this->api) {
1033
+                    $rdf .= clean("&api=".$this->api);
1034 1034
                 }
1035 1035
                 $rdf .= "\"/>\n";
1036 1036
                 $rdf .= "        </sioct:WikiArticle>\n";
1037 1037
                 $rdf .= "    </sioc:links_to>\n";
1038 1038
             }
1039 1039
         }
1040
-        if(is_array($this->ext_links)) {
1041
-            foreach($this->ext_links as $label => $url) {
1042
-                $rdf .= "    <sioc:links_to rdf:resource=\"" . clean($url) . "\"/>\n";
1040
+        if (is_array($this->ext_links)) {
1041
+            foreach ($this->ext_links as $label => $url) {
1042
+                $rdf .= "    <sioc:links_to rdf:resource=\"".clean($url)."\"/>\n";
1043 1043
             }
1044 1044
         }
1045
-        if($this->previous_version) {
1045
+        if ($this->previous_version) {
1046 1046
             $rdf .= "    <sioc:previous_version>\n";
1047
-            $rdf .= "        <sioct:WikiArticle rdf:about=\"" . clean($this->previous_version) . "\">\n";
1048
-            $rdf .= "            <rdfs:seeAlso rdf:resource=\"" .
1049
-                clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki=' . $this->previous_version);
1050
-            if($this->api) {
1051
-                $rdf .= clean("&api=" . $this->api);
1047
+            $rdf .= "        <sioct:WikiArticle rdf:about=\"".clean($this->previous_version)."\">\n";
1048
+            $rdf .= "            <rdfs:seeAlso rdf:resource=\"".
1049
+                clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki='.$this->previous_version);
1050
+            if ($this->api) {
1051
+                $rdf .= clean("&api=".$this->api);
1052 1052
             }
1053 1053
             $rdf .= "\"/>\n";
1054 1054
             $rdf .= "        </sioct:WikiArticle>\n";
@@ -1066,13 +1066,13 @@  discard block
 block discarded – undo
1066 1066
             $rdf .= "    </sioc:earlier_version>\n";
1067 1067
              */
1068 1068
         }
1069
-        if($this->next_version) {
1069
+        if ($this->next_version) {
1070 1070
             $rdf .= "    <sioc:next_version>\n";
1071
-            $rdf .= "        <sioct:WikiArticle rdf:about=\"" . clean($this->next_version) . "\">\n";
1072
-            $rdf .= "            <rdfs:seeAlso rdf:resource=\"" .
1073
-                clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki=' . $this->next_version);
1074
-            if($this->api) {
1075
-                $rdf .= clean("&api=" . $this->api);
1071
+            $rdf .= "        <sioct:WikiArticle rdf:about=\"".clean($this->next_version)."\">\n";
1072
+            $rdf .= "            <rdfs:seeAlso rdf:resource=\"".
1073
+                clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki='.$this->next_version);
1074
+            if ($this->api) {
1075
+                $rdf .= clean("&api=".$this->api);
1076 1076
             }
1077 1077
             $rdf .= "\"/>\n";
1078 1078
             $rdf .= "        </sioct:WikiArticle>\n";
@@ -1090,46 +1090,46 @@  discard block
 block discarded – undo
1090 1090
             $rdf .= "    </sioc:later_version>\n";
1091 1091
              */
1092 1092
         }
1093
-        if($this->latest_version) {
1093
+        if ($this->latest_version) {
1094 1094
             $rdf .= "    <sioc:latest_version>\n";
1095
-            $rdf .= "        <sioct:WikiArticle rdf:about=\"" . clean($this->latest_version) . "\">\n";
1096
-            $rdf .= "            <rdfs:seeAlso rdf:resource=\"" .
1097
-                clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki=' . $this->latest_version);
1098
-            if($this->api) {
1099
-                $rdf .= clean("&api=" . $this->api);
1095
+            $rdf .= "        <sioct:WikiArticle rdf:about=\"".clean($this->latest_version)."\">\n";
1096
+            $rdf .= "            <rdfs:seeAlso rdf:resource=\"".
1097
+                clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki='.$this->latest_version);
1098
+            if ($this->api) {
1099
+                $rdf .= clean("&api=".$this->api);
1100 1100
             }
1101 1101
             $rdf .= "\"/>\n";
1102 1102
             $rdf .= "        </sioct:WikiArticle>\n";
1103 1103
             $rdf .= "    </sioc:latest_version>\n";
1104 1104
         }
1105
-        if($this->has_discussion && (strpos($this->has_discussion, 'Talk:Talk:') == false)) {
1105
+        if ($this->has_discussion && (strpos($this->has_discussion, 'Talk:Talk:') == false)) {
1106 1106
             $rdf .= "    <sioc:has_discussion>\n";
1107
-            $rdf .= "        <sioct:WikiArticle rdf:about=\"" . clean($this->has_discussion) . "\">\n";
1108
-            $rdf .= "            <rdfs:seeAlso rdf:resource=\"" .
1109
-                clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki=' . $this->has_discussion);
1110
-            if($this->api) {
1111
-                $rdf .= clean("&api=" . $this->api);
1107
+            $rdf .= "        <sioct:WikiArticle rdf:about=\"".clean($this->has_discussion)."\">\n";
1108
+            $rdf .= "            <rdfs:seeAlso rdf:resource=\"".
1109
+                clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki='.$this->has_discussion);
1110
+            if ($this->api) {
1111
+                $rdf .= clean("&api=".$this->api);
1112 1112
             }
1113 1113
             $rdf .= "\"/>\n";
1114 1114
             $rdf .= "        </sioct:WikiArticle>\n";
1115 1115
             $rdf .= "    </sioc:has_discussion>\n";
1116 1116
         }
1117
-        if($this->has_container) {
1117
+        if ($this->has_container) {
1118 1118
             $rdf .= "    <sioc:has_container>\n";
1119
-            $rdf .= "        <sioct:Wiki rdf:about=\"" . clean($this->has_container) . "\"/>\n";
1119
+            $rdf .= "        <sioct:Wiki rdf:about=\"".clean($this->has_container)."\"/>\n";
1120 1120
             $rdf .= "    </sioc:has_container>\n";
1121 1121
         }
1122
-        if($this->redirpage) {
1123
-            $rdf .= "    <owl:sameAs rdf:resource=\"" . clean($this->redirpage) . "\"/>\n";
1124
-            $rdf .= "    <rdfs:seeAlso rdf:resource=\"" .
1125
-                clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki=' . $this->redirpage);
1126
-            if($this->api) {
1127
-                $rdf .= clean("&api=" . $this->api);
1122
+        if ($this->redirpage) {
1123
+            $rdf .= "    <owl:sameAs rdf:resource=\"".clean($this->redirpage)."\"/>\n";
1124
+            $rdf .= "    <rdfs:seeAlso rdf:resource=\"".
1125
+                clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki='.$this->redirpage);
1126
+            if ($this->api) {
1127
+                $rdf .= clean("&api=".$this->api);
1128 1128
             }
1129 1129
             $rdf .= "\"/>\n";
1130 1130
         }
1131 1131
 
1132
-        $rdf .= "</" . $this->_type . ">\n";
1132
+        $rdf .= "</".$this->_type.">\n";
1133 1133
         return $rdf;
1134 1134
     }
1135 1135
 }
@@ -1150,7 +1150,7 @@  discard block
 block discarded – undo
1150 1150
     }
1151 1151
 
1152 1152
     public function getContent(&$exp): string {
1153
-        $rdf = '<' . $this->type . " rdf:about=\"" . clean($this->url) . "\"/>\n";
1153
+        $rdf = '<'.$this->type." rdf:about=\"".clean($this->url)."\"/>\n";
1154 1154
         return $rdf;
1155 1155
     }
1156 1156
 }
@@ -1171,7 +1171,7 @@  discard block
 block discarded – undo
1171 1171
     }
1172 1172
 
1173 1173
     public function getContent(&$exp): string {
1174
-        $rdf = '<' . $this->type . " rdf:about=\"" . clean($this->url) . "\"/>\n";
1174
+        $rdf = '<'.$this->type." rdf:about=\"".clean($this->url)."\"/>\n";
1175 1175
         return $rdf;
1176 1176
     }
1177 1177
 }
@@ -1181,13 +1181,13 @@  discard block
 block discarded – undo
1181 1181
  *
1182 1182
  * Transforms text so that it can be safely put into XML markup
1183 1183
  */
1184
-if(!function_exists('clean')) {
1184
+if (!function_exists('clean')) {
1185 1185
     function clean($text, $url = false) {
1186 1186
 #    return htmlentities( $text );
1187 1187
 #    return htmlentities2( $text );
1188 1188
         // double encoding is preventable now
1189 1189
         // $text = htmlspecialchars_decode($text, ENT_COMPAT);
1190
-        if($url) {
1190
+        if ($url) {
1191 1191
             $text = str_replace('&amp;', '&', $text);
1192 1192
         }
1193 1193
         return htmlspecialchars($text, ENT_COMPAT, 'UTF-8');
@@ -1199,7 +1199,7 @@  discard block
 block discarded – undo
1199 1199
  *
1200 1200
  * Same a HTMLEntities, but avoids double-encoding of entities
1201 1201
  */
1202
-if(!function_exists('htmlentities2')) {
1202
+if (!function_exists('htmlentities2')) {
1203 1203
     function htmlentities2($myHTML) {
1204 1204
         $translation_table          = get_html_translation_table(HTML_ENTITIES, ENT_QUOTES);
1205 1205
         $translation_table[chr(38)] = '&';
@@ -1216,7 +1216,7 @@  discard block
 block discarded – undo
1216 1216
  *
1217 1217
  * Prepares text-only representation of HTML content
1218 1218
  */
1219
-if(!function_exists('pureContent')) {
1219
+if (!function_exists('pureContent')) {
1220 1220
     function pureContent($content) {
1221 1221
         // Remove HTML tags
1222 1222
         // May add more cleanup code later, if validation errors are found
Please login to merge, or discard this patch.