@@ -47,7 +47,10 @@ discard block |
||
| 47 | 47 | function addCreator($creator) { $this->_creator = $creator; } |
| 48 | 48 | function addContributors($contributors) { $this->_contributors = $contributors; } |
| 49 | 49 | function isCreator() { $this->_is_creator = true; } |
| 50 | - function addLinks($links) { if (is_array($links) && count($links) > 0) $this->_links = $links; } |
|
| 50 | + function addLinks($links) { if (is_array($links) && count($links) > 0) { |
|
| 51 | + $this->_links = $links; |
|
| 52 | + } |
|
| 53 | + } |
|
| 51 | 54 | function addBacklinks($links) { $this->_backlinks = $links; } |
| 52 | 55 | //function addLinksExtern($links) { if (is_array($links) && count($links)>0) $this->_ext_links = $links; } |
| 53 | 56 | function addVersionPrevious($rev) { $this->_previous_version = $rev; } |
@@ -74,8 +77,9 @@ discard block |
||
| 74 | 77 | { |
| 75 | 78 | foreach ($this->_contributors as $cont_id => $cont_name) |
| 76 | 79 | { |
| 77 | - if (!isset($this->_creator['sioc:modifier']) || ($this->_creator['sioc:modifier'] != $cont_id)) |
|
| 78 | - $rdf .= "\t<sioc:has_modifier rdf:resource=\"".normalizeUri($exp->siocURL('user', $cont_id))."\" rdfs:label=\"".clean($cont_name)."\"/>\n"; |
|
| 80 | + if (!isset($this->_creator['sioc:modifier']) || ($this->_creator['sioc:modifier'] != $cont_id)) { |
|
| 81 | + $rdf .= "\t<sioc:has_modifier rdf:resource=\"".normalizeUri($exp->siocURL('user', $cont_id))."\" rdfs:label=\"".clean($cont_name)."\"/>\n"; |
|
| 82 | + } |
|
| 79 | 83 | } |
| 80 | 84 | |
| 81 | 85 | if (isset($this->_contributors[$this->_creator['sioc:modifier']])) |
@@ -274,7 +278,9 @@ discard block |
||
| 274 | 278 | |
| 275 | 279 | function getContent(&$exp) { |
| 276 | 280 | $rdf = "<sioc:UserAccount rdf:about=\"".clean($this->_url, true)."\">\n"; |
| 277 | - if ($this->_nick) $rdf .= "\t<sioc:name>".clean($this->_nick)."</sioc:name>\n"; |
|
| 281 | + if ($this->_nick) { |
|
| 282 | + $rdf .= "\t<sioc:name>".clean($this->_nick)."</sioc:name>\n"; |
|
| 283 | + } |
|
| 278 | 284 | if ($this->_email) { |
| 279 | 285 | if ($exp->_export_email) { $rdf .= "\t<sioc:email rdf:resource=\"".$this->_email."\"/>\n"; } |
| 280 | 286 | $rdf .= "\t<sioc:email_sha1>".$this->_sha1."</sioc:email_sha1>\n"; |
@@ -288,7 +294,9 @@ discard block |
||
| 288 | 294 | } |
| 289 | 295 | $rdf .= "\t<sioc:account_of>\n"; |
| 290 | 296 | $rdf .= "\t\t<foaf:Person>\n"; |
| 291 | - if ($this->_name) $rdf .= "\t\t\t<foaf:name>".clean($this->_name)."</foaf:name>\n"; |
|
| 297 | + if ($this->_name) { |
|
| 298 | + $rdf .= "\t\t\t<foaf:name>".clean($this->_name)."</foaf:name>\n"; |
|
| 299 | + } |
|
| 292 | 300 | if ($this->_email) { $rdf .= "\t\t\t<foaf:mbox_sha1sum>".$this->_sha1."</foaf:mbox_sha1sum>\n"; } |
| 293 | 301 | if ($this->_foaf_url) { $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"".$this->_foaf_url."\"/>\n"; } |
| 294 | 302 | $rdf .= "\t\t</foaf:Person>\n"; |
@@ -100,10 +100,11 @@ discard block |
||
| 100 | 100 | $type_part = $this->_url4type .$this->_urlequal . $type ; |
| 101 | 101 | |
| 102 | 102 | if ($id) { |
| 103 | - if ( isset($this->_type_table[$type]) ) |
|
| 104 | - $myID = $this->_type_table[$type] ; |
|
| 105 | - else |
|
| 106 | - $myID = (($this->_url_usetype) ? $type . '_' : '') . $this->_url4id ; |
|
| 103 | + if ( isset($this->_type_table[$type]) ) { |
|
| 104 | + $myID = $this->_type_table[$type] ; |
|
| 105 | + } else { |
|
| 106 | + $myID = (($this->_url_usetype) ? $type . '_' : '') . $this->_url4id ; |
|
| 107 | + } |
|
| 107 | 108 | |
| 108 | 109 | $id_part = $this->_urlseparator . $myID . $this->_urlequal . $id ; |
| 109 | 110 | } else { |
@@ -145,10 +146,14 @@ discard block |
||
| 145 | 146 | <admin:generatorAgent rdf:resource="'.clean($this->_generator, true).'"/> |
| 146 | 147 | <admin:generatorAgent rdf:resource="'.clean(EXPORTER_URL, true).'?version='.EXPORTER_VERSION.'"/> |
| 147 | 148 | </foaf:Document>'."\n"; |
| 148 | - if ($rdf_content) $rdf .= $rdf_content; |
|
| 149 | + if ($rdf_content) { |
|
| 150 | + $rdf .= $rdf_content; |
|
| 151 | + } |
|
| 149 | 152 | if (sizeof($this->_objects)) { |
| 150 | 153 | foreach ($this->_objects as $object) { |
| 151 | - if ($object) $rdf .= $object->getContent($this); |
|
| 154 | + if ($object) { |
|
| 155 | + $rdf .= $object->getContent($this); |
|
| 156 | + } |
|
| 152 | 157 | } |
| 153 | 158 | } |
| 154 | 159 | $rdf .= "\n</rdf:RDF>"; |
@@ -328,12 +333,16 @@ discard block |
||
| 328 | 333 | |
| 329 | 334 | function getContent(&$exp) { |
| 330 | 335 | $rdf = "<foaf:Person rdf:about=\"".clean($this->_foaf_uri)."\">\n"; |
| 331 | - if ($this->_name) $rdf .= "\t<foaf:name>".$this->_name."</foaf:name>\n"; |
|
| 336 | + if ($this->_name) { |
|
| 337 | + $rdf .= "\t<foaf:name>".$this->_name."</foaf:name>\n"; |
|
| 338 | + } |
|
| 332 | 339 | if ($this->_email) { $rdf .= "\t<foaf:mbox_sha1sum>".$this->_sha1."</foaf:mbox_sha1sum>\n"; } |
| 333 | 340 | if ($this->_foaf_url) { $rdf .= "\t<rdfs:seeAlso rdf:resource=\"".$this->_foaf_url."\"/>\n"; } |
| 334 | 341 | $rdf .= "\t<foaf:holdsAccount>\n"; |
| 335 | 342 | $rdf .= "\t\t<sioc:UserAccount rdf:about=\"".clean($this->_uri)."\">\n"; |
| 336 | - if ($this->_nick) $rdf .= "\t\t\t<sioc:name>".$this->_nick."</sioc:name>\n"; |
|
| 343 | + if ($this->_nick) { |
|
| 344 | + $rdf .= "\t\t\t<sioc:name>".$this->_nick."</sioc:name>\n"; |
|
| 345 | + } |
|
| 337 | 346 | if ($this->_email) { |
| 338 | 347 | if ($exp->_export_email) { $rdf .= "\t\t\t<sioc:email rdf:resource=\"".$this->_email."\"/>\n"; } |
| 339 | 348 | $rdf .= "\t\t\t<sioc:email_sha1>".$this->_sha1."</sioc:email_sha1>\n"; |
@@ -409,8 +418,12 @@ discard block |
||
| 409 | 418 | function getContent( &$exp) { |
| 410 | 419 | $rdf .= '<sioc:Thread rdf:about="' . clean($this->_url) . "\">\n"; |
| 411 | 420 | $rdf .= "\t<sioc:link rdf:resource=\"" . clean($this->_url) . "\"/>\n"; |
| 412 | - if ($this->_views) $rdf .= "\t<sioc:num_views>" . $this->_views . "</sioc:num_views>\n"; |
|
| 413 | - if ($this->_note) $rdf .= "\t<rdfs:comment>" . $this->_note . "</rdfs:comment>\n"; |
|
| 421 | + if ($this->_views) { |
|
| 422 | + $rdf .= "\t<sioc:num_views>" . $this->_views . "</sioc:num_views>\n"; |
|
| 423 | + } |
|
| 424 | + if ($this->_note) { |
|
| 425 | + $rdf .= "\t<rdfs:comment>" . $this->_note . "</rdfs:comment>\n"; |
|
| 426 | + } |
|
| 414 | 427 | if ($this->_subject) { $rdf .= "\t<dc:title>" . $this->_subject . "</dc:title>\n"; } |
| 415 | 428 | if ($this->_created) { $rdf .= "\t<dcterms:created>" . $this->_created . "</dcterms:created>\n"; } |
| 416 | 429 | if ($this->_parents) { |
@@ -536,11 +549,19 @@ discard block |
||
| 536 | 549 | |
| 537 | 550 | function getContent( &$exp) { |
| 538 | 551 | $rdf .= '<'.$this->_type. ' rdf:about="' . clean($this->_url) . "\">\n"; |
| 539 | - if ($this->_type != 'sioc:Forum') $rdf .= "\t<rdf:type rdf:resource=\"http://rdfs.org/sioc/ns#Forum\" />\n"; |
|
| 552 | + if ($this->_type != 'sioc:Forum') { |
|
| 553 | + $rdf .= "\t<rdf:type rdf:resource=\"http://rdfs.org/sioc/ns#Forum\" />\n"; |
|
| 554 | + } |
|
| 540 | 555 | $rdf .= "\t<sioc:link rdf:resource=\"" . clean($this->_url) . "\"/>\n"; |
| 541 | - if ($this->_blog_title) $rdf .= "\t<dc:title>" . $this->_blog_title . "</dc:title>\n"; |
|
| 542 | - if ($this->_description) $rdf .= "\t<dc:description>" . $this->_description . "</dc:description>\n"; |
|
| 543 | - if ($this->_note) $rdf .= "\t<rdfs:comment>" . $this->_note . "</rdfs:comment>\n"; |
|
| 556 | + if ($this->_blog_title) { |
|
| 557 | + $rdf .= "\t<dc:title>" . $this->_blog_title . "</dc:title>\n"; |
|
| 558 | + } |
|
| 559 | + if ($this->_description) { |
|
| 560 | + $rdf .= "\t<dc:description>" . $this->_description . "</dc:description>\n"; |
|
| 561 | + } |
|
| 562 | + if ($this->_note) { |
|
| 563 | + $rdf .= "\t<rdfs:comment>" . $this->_note . "</rdfs:comment>\n"; |
|
| 564 | + } |
|
| 544 | 565 | |
| 545 | 566 | if ($this->_parents) { |
| 546 | 567 | foreach($this->_parents as $id => $uri) { |
@@ -576,23 +597,32 @@ discard block |
||
| 576 | 597 | if ($this->_creator->_id) { |
| 577 | 598 | $rdf .= "\t<sioc:has_creator>\n"; |
| 578 | 599 | $rdf .= "\t\t<sioc:UserAccount rdf:about=\"".clean($this->_creator->_uri)."\">\n"; |
| 579 | - if ($this->_creator->_sioc_url) { $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"".$this->_creator->_sioc_url."\"/>\n"; } |
|
| 580 | - else $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"".$exp->siocURL('user', $this->_creator->_id)."\"/>\n"; |
|
| 600 | + if ($this->_creator->_sioc_url) { $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"".$this->_creator->_sioc_url."\"/>\n"; } else { |
|
| 601 | + $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"".$exp->siocURL('user', $this->_creator->_id)."\"/>\n"; |
|
| 602 | + } |
|
| 581 | 603 | $rdf .= "\t\t</sioc:UserAccount>\n"; |
| 582 | 604 | $rdf .= "\t</sioc:has_creator>\n"; |
| 583 | 605 | $rdf .= "\t<foaf:maker>\n"; |
| 584 | 606 | $rdf .= "\t\t<foaf:Person rdf:about=\"".clean($this->_creator->_foaf_uri)."\">\n"; |
| 585 | - if ($this->_creator->_foaf_url) { $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"".$this->_creator->_foaf_url."\"/>\n"; } |
|
| 586 | - else $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"".$exp->siocURL('user', $this->_creator->_id)."\"/>\n"; |
|
| 607 | + if ($this->_creator->_foaf_url) { $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"".$this->_creator->_foaf_url."\"/>\n"; } else { |
|
| 608 | + $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"".$exp->siocURL('user', $this->_creator->_id)."\"/>\n"; |
|
| 609 | + } |
|
| 587 | 610 | $rdf .= "\t\t</foaf:Person>\n"; |
| 588 | 611 | $rdf .= "\t</foaf:maker>\n"; |
| 589 | 612 | } else { |
| 590 | 613 | $rdf .= "\t<foaf:maker>\n"; |
| 591 | 614 | $rdf .= "\t\t<foaf:Person"; |
| 592 | - if ($this->_creator->_name) $rdf .= " foaf:name=\"".$this->_creator->_name."\""; |
|
| 593 | - if ($this->_creator->_sha1) $rdf .= " foaf:mbox_sha1sum=\"".$this->_creator->_sha1."\""; |
|
| 594 | - if ($this->_creator->_name) $rdf .= ">\n\t\t\t<foaf:homepage rdf:resource=\"".$this->_creator->_homepage."\"/>\n\t\t</foaf:Person>\n"; |
|
| 595 | - else $rdf .= "/>\n"; |
|
| 615 | + if ($this->_creator->_name) { |
|
| 616 | + $rdf .= " foaf:name=\"".$this->_creator->_name."\""; |
|
| 617 | + } |
|
| 618 | + if ($this->_creator->_sha1) { |
|
| 619 | + $rdf .= " foaf:mbox_sha1sum=\"".$this->_creator->_sha1."\""; |
|
| 620 | + } |
|
| 621 | + if ($this->_creator->_name) { |
|
| 622 | + $rdf .= ">\n\t\t\t<foaf:homepage rdf:resource=\"".$this->_creator->_homepage."\"/>\n\t\t</foaf:Person>\n"; |
|
| 623 | + } else { |
|
| 624 | + $rdf .= "/>\n"; |
|
| 625 | + } |
|
| 596 | 626 | $rdf .= "\t</foaf:maker>\n"; |
| 597 | 627 | } |
| 598 | 628 | } |
@@ -601,8 +631,9 @@ discard block |
||
| 601 | 631 | if ($this->_administrator->_id) { |
| 602 | 632 | $rdf .= "\t<sioc:has_administrator>\n"; |
| 603 | 633 | $rdf .= "\t\t<sioc:UserAccount rdf:about=\"" . clean($this->_administrator->_uri) ."\">\n"; |
| 604 | - if($this->_administrator->_sioc_url) { $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"". $this->_administrator->_sioc_url ."\"/>\n"; } |
|
| 605 | - else $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('user', $this->_administrator->_id). "\"/>\n"; |
|
| 634 | + if($this->_administrator->_sioc_url) { $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"". $this->_administrator->_sioc_url ."\"/>\n"; } else { |
|
| 635 | + $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('user', $this->_administrator->_id). "\"/>\n"; |
|
| 636 | + } |
|
| 606 | 637 | $rdf .= "\t\t</sioc:UserAccount>\n"; |
| 607 | 638 | $rdf .= "\t</sioc:has_administrator>\n"; |
| 608 | 639 | } |
@@ -671,7 +702,9 @@ discard block |
||
| 671 | 702 | |
| 672 | 703 | function getContent( &$exp ) { |
| 673 | 704 | $rdf = '<'.$this->_type." rdf:about=\"" . clean($this->_url) . "\">\n"; |
| 674 | - if ($this->_type != 'sioc:Post') $rdf .= "\t<rdf:type rdf:resource=\"http://rdfs.org/sioc/ns#Post\" />\n"; |
|
| 705 | + if ($this->_type != 'sioc:Post') { |
|
| 706 | + $rdf .= "\t<rdf:type rdf:resource=\"http://rdfs.org/sioc/ns#Post\" />\n"; |
|
| 707 | + } |
|
| 675 | 708 | if ($this->_subject) { $rdf .= "\t<dc:title>" . $this->_subject . "</dc:title>\n"; } |
| 676 | 709 | if ($this->_creator) { |
| 677 | 710 | if ($this->_creator->_id) { |
@@ -707,7 +740,9 @@ discard block |
||
| 707 | 740 | } |
| 708 | 741 | } |
| 709 | 742 | $rdf .= "\t<dcterms:created>" . $this->_created . "</dcterms:created>\n"; |
| 710 | - if ($this->_updated AND ($this->_created != $this->_updated) ) $rdf .= "\t<dcterms:modified>" . $this->_updated . "</dcterms:modified>\n"; |
|
| 743 | + if ($this->_updated AND ($this->_created != $this->_updated) ) { |
|
| 744 | + $rdf .= "\t<dcterms:modified>" . $this->_updated . "</dcterms:modified>\n"; |
|
| 745 | + } |
|
| 711 | 746 | $rdf .= "\t<sioc:content>" . pureContent($this->_content) . "</sioc:content>\n"; |
| 712 | 747 | |
| 713 | 748 | $rdf .= "\t<content:encoded><![CDATA[" . $this->_encoded . "]]></content:encoded>\n"; |
@@ -801,8 +836,9 @@ discard block |
||
| 801 | 836 | if ($this->_subject) |
| 802 | 837 | { |
| 803 | 838 | $rdf .= "\t<dc:title>".clean($this->_subject)."</dc:title>\n"; |
| 804 | - if (strcmp($this->_has_container, 'http://en.wikipedia.org') === 0) |
|
| 805 | - $rdf .= "\t<foaf:primaryTopic rdf:resource=\"".clean('http://dbpedia.org/resource/'.$this->_subject)."\"/>\n"; |
|
| 839 | + if (strcmp($this->_has_container, 'http://en.wikipedia.org') === 0) { |
|
| 840 | + $rdf .= "\t<foaf:primaryTopic rdf:resource=\"".clean('http://dbpedia.org/resource/'.$this->_subject)."\"/>\n"; |
|
| 841 | + } |
|
| 806 | 842 | } |
| 807 | 843 | if ($this->_creator->_nick) { |
| 808 | 844 | /*if ($this->_creator->_id) { |
@@ -823,7 +859,9 @@ discard block |
||
| 823 | 859 | $rdf .= "\t\t<sioc:UserAccount rdf:about=\"".clean($this->_creator->_uri)."\">\n"; |
| 824 | 860 | $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"". |
| 825 | 861 | clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki='.$this->_creator->_uri); |
| 826 | - if ($this->_api) $rdf .= clean("&api=".$this->_api); |
|
| 862 | + if ($this->_api) { |
|
| 863 | + $rdf .= clean("&api=".$this->_api); |
|
| 864 | + } |
|
| 827 | 865 | $rdf .= "\"/>\n"; |
| 828 | 866 | $rdf .= "\t\t</sioc:UserAccount>\n"; |
| 829 | 867 | $rdf .= "\t</sioc:has_creator>\n"; |
@@ -854,7 +892,9 @@ discard block |
||
| 854 | 892 | $rdf .= "\t\t<sioct:Category rdf:about=\"".clean($url)."\">\n"; |
| 855 | 893 | $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"". |
| 856 | 894 | clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki='.$url); |
| 857 | - if ($this->_api) $rdf .= clean("&api=".$this->_api); |
|
| 895 | + if ($this->_api) { |
|
| 896 | + $rdf .= clean("&api=".$this->_api); |
|
| 897 | + } |
|
| 858 | 898 | $rdf .= "\"/>\n"; |
| 859 | 899 | $rdf .= "\t\t</sioct:Category>\n"; |
| 860 | 900 | $rdf .= "\t</sioc:topic>\n"; |
@@ -866,7 +906,9 @@ discard block |
||
| 866 | 906 | $rdf .= "\t\t<sioct:WikiArticle rdf:about=\"".clean($url)."\">\n"; |
| 867 | 907 | $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"". |
| 868 | 908 | clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki='.$url); |
| 869 | - if ($this->_api) $rdf .= clean("&api=".$this->_api); |
|
| 909 | + if ($this->_api) { |
|
| 910 | + $rdf .= clean("&api=".$this->_api); |
|
| 911 | + } |
|
| 870 | 912 | $rdf .= "\"/>\n"; |
| 871 | 913 | $rdf .= "\t\t</sioct:WikiArticle>\n"; |
| 872 | 914 | $rdf .= "\t</sioc:links_to>\n"; |
@@ -878,7 +920,9 @@ discard block |
||
| 878 | 920 | $rdf .= "\t\t<sioct:WikiArticle rdf:about=\"".clean($this->_links)."\">\n"; |
| 879 | 921 | $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"". |
| 880 | 922 | clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki='.$this->_links); |
| 881 | - if ($this->_api) $rdf .= clean("&api=".$this->_api); |
|
| 923 | + if ($this->_api) { |
|
| 924 | + $rdf .= clean("&api=".$this->_api); |
|
| 925 | + } |
|
| 882 | 926 | $rdf .= "\"/>\n"; |
| 883 | 927 | $rdf .= "\t\t</sioct:WikiArticle>\n"; |
| 884 | 928 | $rdf .= "\t</sioc:links_to>\n"; |
@@ -894,7 +938,9 @@ discard block |
||
| 894 | 938 | $rdf .= "\t\t<sioct:WikiArticle rdf:about=\"".clean($this->_previous_version)."\">\n"; |
| 895 | 939 | $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"". |
| 896 | 940 | clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki='.$this->_previous_version); |
| 897 | - if ($this->_api) $rdf .= clean("&api=".$this->_api); |
|
| 941 | + if ($this->_api) { |
|
| 942 | + $rdf .= clean("&api=".$this->_api); |
|
| 943 | + } |
|
| 898 | 944 | $rdf .= "\"/>\n"; |
| 899 | 945 | $rdf .= "\t\t</sioct:WikiArticle>\n"; |
| 900 | 946 | $rdf .= "\t</sioc:previous_version>\n"; |
@@ -916,7 +962,9 @@ discard block |
||
| 916 | 962 | $rdf .= "\t\t<sioct:WikiArticle rdf:about=\"".clean($this->_next_version)."\">\n"; |
| 917 | 963 | $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"". |
| 918 | 964 | clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki='.$this->_next_version); |
| 919 | - if ($this->_api) $rdf .= clean("&api=".$this->_api); |
|
| 965 | + if ($this->_api) { |
|
| 966 | + $rdf .= clean("&api=".$this->_api); |
|
| 967 | + } |
|
| 920 | 968 | $rdf .= "\"/>\n"; |
| 921 | 969 | $rdf .= "\t\t</sioct:WikiArticle>\n"; |
| 922 | 970 | $rdf .= "\t</sioc:next_version>\n"; |
@@ -938,7 +986,9 @@ discard block |
||
| 938 | 986 | $rdf .= "\t\t<sioct:WikiArticle rdf:about=\"".clean($this->_latest_version)."\">\n"; |
| 939 | 987 | $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"". |
| 940 | 988 | clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki='.$this->_latest_version); |
| 941 | - if ($this->_api) $rdf .= clean("&api=".$this->_api); |
|
| 989 | + if ($this->_api) { |
|
| 990 | + $rdf .= clean("&api=".$this->_api); |
|
| 991 | + } |
|
| 942 | 992 | $rdf .= "\"/>\n"; |
| 943 | 993 | $rdf .= "\t\t</sioct:WikiArticle>\n"; |
| 944 | 994 | $rdf .= "\t</sioc:latest_version>\n"; |
@@ -948,7 +998,9 @@ discard block |
||
| 948 | 998 | $rdf .= "\t\t<sioct:WikiArticle rdf:about=\"".clean($this->_has_discussion)."\">\n"; |
| 949 | 999 | $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"". |
| 950 | 1000 | clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki='.$this->_has_discussion); |
| 951 | - if ($this->_api) $rdf .= clean("&api=".$this->_api); |
|
| 1001 | + if ($this->_api) { |
|
| 1002 | + $rdf .= clean("&api=".$this->_api); |
|
| 1003 | + } |
|
| 952 | 1004 | $rdf .= "\"/>\n"; |
| 953 | 1005 | $rdf .= "\t\t</sioct:WikiArticle>\n"; |
| 954 | 1006 | $rdf .= "\t</sioc:has_discussion>\n"; |
@@ -963,7 +1015,9 @@ discard block |
||
| 963 | 1015 | $rdf .= "\t<owl:sameAs rdf:resource=\"".clean($this->_redirpage)."\"/>\n"; |
| 964 | 1016 | $rdf .= "\t<rdfs:seeAlso rdf:resource=\"". |
| 965 | 1017 | clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki='.$this->_redirpage); |
| 966 | - if ($this->_api) $rdf .= clean("&api=".$this->_api); |
|
| 1018 | + if ($this->_api) { |
|
| 1019 | + $rdf .= clean("&api=".$this->_api); |
|
| 1020 | + } |
|
| 967 | 1021 | $rdf .= "\"/>\n"; |
| 968 | 1022 | } |
| 969 | 1023 | |
@@ -1026,7 +1080,9 @@ discard block |
||
| 1026 | 1080 | # return htmlentities2( $text ); |
| 1027 | 1081 | // double encoding is preventable now |
| 1028 | 1082 | // $text = htmlspecialchars_decode($text, ENT_COMPAT); |
| 1029 | - if ($url) $text = str_replace('&', '&', $text); |
|
| 1083 | + if ($url) { |
|
| 1084 | + $text = str_replace('&', '&', $text); |
|
| 1085 | + } |
|
| 1030 | 1086 | return htmlspecialchars($text, ENT_COMPAT, 'UTF-8'); |
| 1031 | 1087 | } |
| 1032 | 1088 | } |