Passed
Pull Request — master (#2)
by Mark
01:39
created
lib/sioc_dokuwiki.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -266,7 +266,7 @@
 block discarded – undo
266 266
                 $this->_sha1 = sha1("mailto:".$email);
267 267
             }
268 268
         }
269
-     }
269
+      }
270 270
 
271 271
     function getContent( &$exp ) {
272 272
         $rdf = "<sioc:UserAccount rdf:about=\"" . clean($this->_url, true) ."\">\n";
Please login to merge, or discard this patch.
Braces   +19 added lines, -7 removed lines patch added patch discarded remove patch
@@ -47,7 +47,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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']]))
@@ -90,8 +94,12 @@  discard block
 block discarded – undo
90 94
             //     $rdf .= "\t<foaf:maker rdf:resource=\"".clean($this->_creator['foaf:maker'])."\"/>\n";
91 95
             if ($this->_creator['sioc:modifier'])
92 96
             {
93
-                if ($this->_is_creator === false) $rdf .= "\t<sioc:has_modifier rdf:resource=\"".normalizeUri($exp->siocURL('user', $this->_creator['sioc:modifier']))."\" $creator_name/>\n";
94
-                if ($this->_is_creator === true) $rdf .= "\t<sioc:has_creator rdf:resource=\"".normalizeUri($exp->siocURL('user', $this->_creator['sioc:modifier']))."\" $creator_name/>\n";
97
+                if ($this->_is_creator === false) {
98
+                  $rdf .= "\t<sioc:has_modifier rdf:resource=\"".normalizeUri($exp->siocURL('user', $this->_creator['sioc:modifier']))."\" $creator_name/>\n";
99
+                }
100
+                if ($this->_is_creator === true) {
101
+                  $rdf .= "\t<sioc:has_creator rdf:resource=\"".normalizeUri($exp->siocURL('user', $this->_creator['sioc:modifier']))."\" $creator_name/>\n";
102
+                }
95 103
             }
96 104
         }
97 105
         
@@ -270,7 +278,9 @@  discard block
 block discarded – undo
270 278
 
271 279
     function getContent( &$exp ) {
272 280
         $rdf = "<sioc:UserAccount rdf:about=\"" . clean($this->_url, true) ."\">\n";
273
-        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
+        }
274 284
         if($this->_email) {
275 285
             if ($exp->_export_email) { $rdf .= "\t<sioc:email rdf:resource=\"" . $this->_email ."\"/>\n"; }
276 286
             $rdf .= "\t<sioc:email_sha1>" . $this->_sha1 . "</sioc:email_sha1>\n";
@@ -284,7 +294,9 @@  discard block
 block discarded – undo
284 294
         }
285 295
         $rdf .= "\t<sioc:account_of>\n";
286 296
         $rdf .= "\t\t<foaf:Person>\n";
287
-        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
+        }
288 300
         if($this->_email) { $rdf .= "\t\t\t<foaf:mbox_sha1sum>" . $this->_sha1 . "</foaf:mbox_sha1sum>\n"; }
289 301
         if($this->_foaf_url) { $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"". $this->_foaf_url ."\"/>\n"; }
290 302
         $rdf .= "\t\t</foaf:Person>\n";  
Please login to merge, or discard this patch.
lib/sioc_inc.php 2 patches
Indentation   +105 added lines, -105 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
         $this->_sioc_url = $sioc_url;
79 79
         $this->_encoding = $encoding;
80 80
         $this->_generator = $generator;
81
-	$this->_export_email = $export_email;
81
+  $this->_export_email = $export_email;
82 82
     }
83 83
 	
84 84
     // Assigns some objects to the exporter
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
         $this->_objects[] = &$obj;
87 87
     }
88 88
 
89
-	// TS: Used to replace _url4id in the siocURL for a given type (site, forum, etc.) with a parameter ($name) of your choice 
90
-	// E.g. b2evo exporter uses "blog=" instead of "sioc_id=" in the siocURL of a forum
89
+  // TS: Used to replace _url4id in the siocURL for a given type (site, forum, etc.) with a parameter ($name) of your choice 
90
+  // E.g. b2evo exporter uses "blog=" instead of "sioc_id=" in the siocURL of a forum
91 91
     function setURLTypeParm($type, $name) {
92 92
         $this->_type_table[$type] = $name;
93 93
     } 
@@ -96,27 +96,27 @@  discard block
 block discarded – undo
96 96
         $this->_ignore_suffix[$type] = 1;
97 97
     }
98 98
 
99
-	function siocURL($type, $id, $page=""){
100
-		$type_part = $this->_url4type .$this->_urlequal .  $type ;
99
+  function siocURL($type, $id, $page=""){
100
+    $type_part = $this->_url4type .$this->_urlequal .  $type ;
101 101
 			
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 ;
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 ;
107 107
 				
108
-			$id_part = $this->_urlseparator . $myID . $this->_urlequal . $id  ;
109
-		} else {
110
-			$id_part = '';
111
-		}
108
+      $id_part = $this->_urlseparator . $myID . $this->_urlequal . $id  ;
109
+    } else {
110
+      $id_part = '';
111
+    }
112 112
 		
113
-		($page) ? $page_part = $this->_urlseparator . $this->_url4page . $this->_urlequal . $page : $page_part='' ;
113
+    ($page) ? $page_part = $this->_urlseparator . $this->_url4page . $this->_urlequal . $page : $page_part='' ;
114 114
 			
115
-		($this->_url_suffix && !isset($this->_ignore_suffix[$type])) ? $suffix = $this->_urlseparator . $this->_url_suffix : $suffix = '';
115
+    ($this->_url_suffix && !isset($this->_ignore_suffix[$type])) ? $suffix = $this->_urlseparator . $this->_url_suffix : $suffix = '';
116 116
 		
117
-		$siocURL = $this->_sioc_url . $type_part . $id_part . $page_part . $suffix ;
118
-		return clean($siocURL, true);
119
-	}
117
+    $siocURL = $this->_sioc_url . $type_part . $id_part . $page_part . $suffix ;
118
+    return clean($siocURL, true);
119
+  }
120 120
 	
121 121
     function export( $rdf_content='' ) {
122 122
         header('Content-Type: application/rdf+xml; charset='.$this->_encoding, true, 200);
@@ -204,10 +204,10 @@  discard block
 block discarded – undo
204 204
         $this->_description = $description;
205 205
         $this->_forums = array();
206 206
         $this->_users = array();
207
-	$this->_page = $page;
208
-	$this->_next_users = false;
209
-       	$this->_next_forums = false;
210
-       	$this->_usergroup_uri = $usergroup_uri;
207
+  $this->_page = $page;
208
+  $this->_next_users = false;
209
+          $this->_next_forums = false;
210
+          $this->_usergroup_uri = $usergroup_uri;
211 211
     }
212 212
     
213 213
     function addForum($id, $url) {
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
         $this->_users[$id] = $url;
219 219
     } 
220 220
 	
221
-	function setNextPageUsers($next) {
221
+  function setNextPageUsers($next) {
222 222
         $this->_next_users = $next;
223 223
     }
224 224
 	
@@ -236,14 +236,14 @@  discard block
 block discarded – undo
236 236
                 $rdf .= "\t<sioc:host_of rdf:resource=\"" . clean($url) . "\"/>\n";
237 237
             }
238 238
         }  
239
-		if($this->_next_forums) {
239
+    if($this->_next_forums) {
240 240
             $rdf .= "\t<rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('site', "", $this->_page+1) ."\"/>\n";
241 241
         }	
242
-		if($this->_usergroup_uri) {
243
-			$rdf .= "\t<sioc:has_Usergroup rdf:resource=\"" . $this->_usergroup_uri . "\"/>\n";
244
-		} else {
245
-			$rdf .= "\t<sioc:has_Usergroup rdf:nodeID=\"" . AUTHORS_NODE . "\"/>\n";
246
-		}
242
+    if($this->_usergroup_uri) {
243
+      $rdf .= "\t<sioc:has_Usergroup rdf:resource=\"" . $this->_usergroup_uri . "\"/>\n";
244
+    } else {
245
+      $rdf .= "\t<sioc:has_Usergroup rdf:nodeID=\"" . AUTHORS_NODE . "\"/>\n";
246
+    }
247 247
         $rdf .= "</sioc:Site>\n";
248 248
         // Forums
249 249
         if($this->_forums) {
@@ -258,11 +258,11 @@  discard block
 block discarded – undo
258 258
         // Usergroup
259 259
         if($this->_users) {
260 260
             $rdf .= "\n";
261
-			if($this->_usergroup_uri) {
262
-				$rdf .= '<sioc:UserAccountgroup rdf:about="' . $this->_usergroup_uri . "\">\n";
263
-			} else {
264
-				$rdf .= '<sioc:UserAccountgroup rdf:nodeID="' . AUTHORS_NODE . "\">\n";
265
-			}
261
+      if($this->_usergroup_uri) {
262
+        $rdf .= '<sioc:UserAccountgroup rdf:about="' . $this->_usergroup_uri . "\">\n";
263
+      } else {
264
+        $rdf .= '<sioc:UserAccountgroup rdf:nodeID="' . AUTHORS_NODE . "\">\n";
265
+      }
266 266
             $rdf .= "\t<sioc:name>Authors for \"" . clean($this->_name) . "\"</sioc:name>\n";
267 267
                 foreach ($this->_users as $id => $url) {
268 268
                     $rdf .= "\t<sioc:has_member>\n";
@@ -271,9 +271,9 @@  discard block
 block discarded – undo
271 271
                     $rdf .= "\t\t</sioc:UserAccount>\n";
272 272
                     $rdf .= "\t</sioc:has_member>\n";
273 273
                 }
274
-			if($this->_next_users) {
274
+      if($this->_next_users) {
275 275
             $rdf .= "\t<rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('site', "", $this->_page+1) ."\"/>\n";
276
-			}
276
+      }
277 277
             $rdf .= "</sioc:UserAccountgroup>\n";
278 278
         }
279 279
 		
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
         $this->_posts[$id] = array("url" => $url, "prev" => $prev, "next" => $next);
394 394
     }
395 395
 
396
-	// add links to things that are similar to this via sioc:related_to 
396
+  // add links to things that are similar to this via sioc:related_to 
397 397
     function addRelated($id, $url) {
398 398
         $this->_related[$id] = $url;
399 399
     }
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
         $this->_next = $next;
403 403
     }
404 404
 	
405
-	function addParentForum($id, $url) {
405
+  function addParentForum($id, $url) {
406 406
         $this->_parents[$id] = $url;
407 407
     }
408 408
 
@@ -411,51 +411,51 @@  discard block
 block discarded – undo
411 411
         $rdf .= "\t<sioc:link rdf:resource=\"" . clean($this->_url) . "\"/>\n";
412 412
         if ($this->_views)  $rdf .= "\t<sioc:num_views>" . $this->_views . "</sioc:num_views>\n";
413 413
         if ($this->_note)   $rdf .= "\t<rdfs:comment>" . $this->_note . "</rdfs:comment>\n";
414
-		if ($this->_subject) { $rdf .= "\t<dc:title>" . $this->_subject . "</dc:title>\n"; }
414
+    if ($this->_subject) { $rdf .= "\t<dc:title>" . $this->_subject . "</dc:title>\n"; }
415 415
         if ($this->_created) { $rdf .= "\t<dcterms:created>" . $this->_created . "</dcterms:created>\n"; }
416 416
         if ($this->_parents) {
417
-			foreach($this->_parents as $id => $uri) {
418
-				$rdf .= "\t<sioc:has_parent>\n";
419
-				$rdf .= "\t\t<sioc:Forum rdf:about=\"" .clean($uri) ."\">\n";
420
-				$rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('forum', $id) . "\"/>\n";
421
-				$rdf .= "\t\t</sioc:Forum>\n";
422
-				$rdf .= "\t</sioc:has_parent>\n";
423
-			}
424
-		}
425
-		// here the tags are just used as keywords for dc:subject
417
+      foreach($this->_parents as $id => $uri) {
418
+        $rdf .= "\t<sioc:has_parent>\n";
419
+        $rdf .= "\t\t<sioc:Forum rdf:about=\"" .clean($uri) ."\">\n";
420
+        $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('forum', $id) . "\"/>\n";
421
+        $rdf .= "\t\t</sioc:Forum>\n";
422
+        $rdf .= "\t</sioc:has_parent>\n";
423
+      }
424
+    }
425
+    // here the tags are just used as keywords for dc:subject
426 426
         if ($this->_tags) { 
427 427
             foreach ($this->_tags as $id => $tag) {
428 428
                 $rdf .= "\t<dc:subject>" . $tag . "</dc:subject>\n"; 
429 429
             }
430 430
         }
431
-		// here the tags are used by creating a tag object with a blank node, with the keyword as moat:name - if you use this insert prefixes for moat and tags
432
-		// if ($this->_tags) { 
433
-			// $i=1;
431
+    // here the tags are used by creating a tag object with a blank node, with the keyword as moat:name - if you use this insert prefixes for moat and tags
432
+    // if ($this->_tags) { 
433
+      // $i=1;
434 434
             // foreach ($this->_tags as $id => $tag) {
435
-				// $rdf .= "\t<tags:taggedWithTag>\n";
436
-				// $rdf .= "\t\t<moat:tag rdf:nodeID=\"b$i\">\n";
437
-				// // actually, the best way is to have 'reference URIs' for tags, e.g. URIs for all the platform (http://tags.example.org/tag/soccer
435
+        // $rdf .= "\t<tags:taggedWithTag>\n";
436
+        // $rdf .= "\t\t<moat:tag rdf:nodeID=\"b$i\">\n";
437
+        // // actually, the best way is to have 'reference URIs' for tags, e.g. URIs for all the platform (http://tags.example.org/tag/soccer
438 438
                 // $rdf .= "\t\t\t<moat:name>" . $tag . "</moat:name>\n";  
439
-				// $rdf .= "\t\t</moat:tag>\n";
440
-				// $rdf .= "\t</moat:taggedWithTag>\n";
441
-				// $i++;
439
+        // $rdf .= "\t\t</moat:tag>\n";
440
+        // $rdf .= "\t</moat:taggedWithTag>\n";
441
+        // $i++;
442 442
             // }
443 443
         // }
444 444
 		
445
-		// here the tags are used are used for sioc:topic, each topic needs to have a URI
446
-		/*if($this->_tags) {
445
+    // here the tags are used are used for sioc:topic, each topic needs to have a URI
446
+    /*if($this->_tags) {
447 447
             foreach($this->_tags as $url=>$topic) {
448 448
                 $rdf .= "\t<sioc:topic rdfs:label=\"$topic\" rdf:resource=\"" . clean($url) ."\"/>\n";
449 449
             }
450 450
         }
451 451
 		*/
452
-		if ($this->_related) { 
453
-			foreach ($this->_related as $id => $url) {
454
-					$rdf .= "\t<sioc:related_to>\n";
455
-					$rdf .= "\t\t<sioc:Thread rdf:about=\"" .clean($url) ."\"/>\n";
456
-					$rdf .= "\t</sioc:related_to>\n"; // todo - each topic needs to have a URI
457
-			}
458
-		}		
452
+    if ($this->_related) { 
453
+      foreach ($this->_related as $id => $url) {
454
+          $rdf .= "\t<sioc:related_to>\n";
455
+          $rdf .= "\t\t<sioc:Thread rdf:about=\"" .clean($url) ."\"/>\n";
456
+          $rdf .= "\t</sioc:related_to>\n"; // todo - each topic needs to have a URI
457
+      }
458
+    }		
459 459
 		
460 460
         if ($this->_posts) {
461 461
             foreach($this->_posts as $id => $data) {
@@ -510,23 +510,23 @@  discard block
 block discarded – undo
510 510
         $this->_next = false;
511 511
         $this->_blog_title = $title;
512 512
         $this->_description = $descr;
513
-       	$this->_threads = array();
514
-       	$this->_parents = array();
515
-       	$this->_type = $type;
516
-       	$this->_creator = $creator;
517
-       	$this->_administrator = $admin;
518
-       	$this->_links = $links;
513
+          $this->_threads = array();
514
+          $this->_parents = array();
515
+          $this->_type = $type;
516
+          $this->_creator = $creator;
517
+          $this->_administrator = $admin;
518
+          $this->_links = $links;
519 519
     }
520 520
 	
521 521
     function addPost($id, $url) {
522 522
         $this->_posts[$id] = $url;
523 523
     }
524 524
 	
525
-	function addThread($id, $url) {
525
+  function addThread($id, $url) {
526 526
         $this->_threads[$id] = $url;
527 527
     }
528 528
 	
529
-	function addParentForum($id, $url) {
529
+  function addParentForum($id, $url) {
530 530
         $this->_parents[$id] = $url;
531 531
     }
532 532
 
@@ -536,31 +536,31 @@  discard block
 block discarded – undo
536 536
 
537 537
     function getContent( &$exp) {
538 538
         $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";
539
+    if ($this->_type != 'sioc:Forum') $rdf .= "\t<rdf:type rdf:resource=\"http://rdfs.org/sioc/ns#Forum\" />\n";
540 540
         $rdf .= "\t<sioc:link rdf:resource=\"" . clean($this->_url) . "\"/>\n";
541 541
         if ($this->_blog_title)  $rdf .= "\t<dc:title>" . $this->_blog_title . "</dc:title>\n";
542 542
         if ($this->_description) $rdf .= "\t<dc:description>" . $this->_description . "</dc:description>\n";
543 543
         if ($this->_note)        $rdf .= "\t<rdfs:comment>" . $this->_note . "</rdfs:comment>\n";
544 544
 		
545
-		if ($this->_parents) {
546
-			foreach($this->_parents as $id => $uri) {
547
-				$rdf .= "\t<sioc:has_parent>\n";
548
-				$rdf .= "\t\t<sioc:Forum rdf:about=\"" .clean($uri) ."\">\n";
549
-				$rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('forum', $id) . "\"/>\n";
550
-				$rdf .= "\t\t</sioc:Forum>\n";
551
-				$rdf .= "\t</sioc:has_parent>\n";
545
+    if ($this->_parents) {
546
+      foreach($this->_parents as $id => $uri) {
547
+        $rdf .= "\t<sioc:has_parent>\n";
548
+        $rdf .= "\t\t<sioc:Forum rdf:about=\"" .clean($uri) ."\">\n";
549
+        $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('forum', $id) . "\"/>\n";
550
+        $rdf .= "\t\t</sioc:Forum>\n";
551
+        $rdf .= "\t</sioc:has_parent>\n";
552 552
             }
553
-		}
553
+    }
554 554
 		
555
-		if ($this->_threads) {
556
-			foreach($this->_threads as $id => $uri) {
557
-				$rdf .= "\t<sioc:parent_of>\n";
558
-				$rdf .= "\t\t<sioc:Thread rdf:about=\"" .clean($uri) ."\">\n";
559
-				$rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('thread', $id) . "\"/>\n";
560
-				$rdf .= "\t\t</sioc:Thread>\n";
561
-				$rdf .= "\t</sioc:parent_of>\n";
555
+    if ($this->_threads) {
556
+      foreach($this->_threads as $id => $uri) {
557
+        $rdf .= "\t<sioc:parent_of>\n";
558
+        $rdf .= "\t\t<sioc:Thread rdf:about=\"" .clean($uri) ."\">\n";
559
+        $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('thread', $id) . "\"/>\n";
560
+        $rdf .= "\t\t</sioc:Thread>\n";
561
+        $rdf .= "\t</sioc:parent_of>\n";
562 562
             }
563
-		}
563
+    }
564 564
 		
565 565
         if($this->_posts) {
566 566
             foreach($this->_posts as $id => $url) {
@@ -572,7 +572,7 @@  discard block
 block discarded – undo
572 572
             }
573 573
         }
574 574
 		
575
-		if ($this->_creator) {
575
+    if ($this->_creator) {
576 576
             if ($this->_creator->_id) {
577 577
                 $rdf .= "\t<sioc:has_creator>\n";
578 578
                 $rdf .= "\t\t<sioc:UserAccount rdf:about=\"" . clean($this->_creator->_uri) ."\">\n";
@@ -597,7 +597,7 @@  discard block
 block discarded – undo
597 597
             }
598 598
         }
599 599
 		
600
-		if ($this->_administrator) {
600
+    if ($this->_administrator) {
601 601
             if ($this->_administrator->_id) {
602 602
                 $rdf .= "\t<sioc:has_administrator>\n";
603 603
                 $rdf .= "\t\t<sioc:UserAccount rdf:about=\"" . clean($this->_administrator->_uri) ."\">\n";
@@ -607,7 +607,7 @@  discard block
 block discarded – undo
607 607
                 $rdf .= "\t</sioc:has_administrator>\n";
608 608
             } 
609 609
         }
610
-		if ($this->_links) {
610
+    if ($this->_links) {
611 611
             foreach($this->_links as $url=>$link) {
612 612
                 $rdf .= "\t<sioc:links_to rdfs:label=\"$link\" rdf:resource=\"" . clean($url) ."\"/>\n";
613 613
             }
@@ -616,7 +616,7 @@  discard block
 block discarded – undo
616 616
         if($this->_next) {
617 617
             $rdf .= "\r<rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('forum', $this->_id, $this->_page+1) ."\"/>\n";
618 618
         }
619
-		$rdf .=  "</".$this->_type.">";
619
+    $rdf .=  "</".$this->_type.">";
620 620
 		
621 621
         return $rdf;
622 622
     }
@@ -657,8 +657,8 @@  discard block
 block discarded – undo
657 657
         $this->_links = $links;
658 658
         $this->_comments = array();
659 659
         $this->_reply_of = array();
660
-       	$this->_type = $type;
661
-       	$this->_has_part = $has_part;
660
+          $this->_type = $type;
661
+          $this->_has_part = $has_part;
662 662
     }
663 663
 
664 664
     function addComment($id, $url) {
@@ -712,11 +712,11 @@  discard block
 block discarded – undo
712 712
                 $rdf .= "\t<sioc:links_to rdfs:label=\"$link\" rdf:resource=\"" . clean($url) ."\"/>\n";
713 713
             }
714 714
         }
715
-		if($this->_has_part) {
715
+    if($this->_has_part) {
716 716
             foreach($this->_has_part as $id=>$url) {
717 717
                 $rdf .= "\t<dcterms:hasPart>\n";
718
-				$rdf .= "\t\t<dcmitype:Image rdf:about=\"" . clean($url) . "\"/>\n";
719
-				$rdf .= "\t</dcterms:hasPart>\n";
718
+        $rdf .= "\t\t<dcmitype:Image rdf:about=\"" . clean($url) . "\"/>\n";
719
+        $rdf .= "\t</dcterms:hasPart>\n";
720 720
             }
721 721
         }
722 722
         if($this->_reply_of) {
@@ -779,9 +779,9 @@  discard block
 block discarded – undo
779 779
         $this->_topics = $topics;
780 780
         $this->_links = $links;
781 781
         $this->_ext_links = $ext_links;
782
-       	$this->_type = $type;
782
+          $this->_type = $type;
783 783
         $this->_previous_version = $prev_vers;
784
-       	$this->_next_version = $next_vers;
784
+          $this->_next_version = $next_vers;
785 785
         $this->_latest_version = $latest_vers;
786 786
         $this->_has_discussion = $has_discuss;
787 787
         $this->_has_container = $container;
@@ -971,7 +971,7 @@  discard block
 block discarded – undo
971 971
 
972 972
     function SIOCWiki ($url, $type='sioct:Wiki') {
973 973
         $this->_url = $url;
974
-       	$this->_type = $type;
974
+          $this->_type = $type;
975 975
     }
976 976
 
977 977
     function getContent( &$exp ) {
@@ -992,7 +992,7 @@  discard block
 block discarded – undo
992 992
 
993 993
     function SIOCCategory ($url, $type='sioct:Category') {
994 994
         $this->_url = $url;
995
-       	$this->_type = $type;
995
+          $this->_type = $type;
996 996
     }
997 997
 
998 998
     function getContent( &$exp ) {
Please login to merge, or discard this patch.
Braces   +111 added lines, -46 removed lines patch added patch discarded remove patch
@@ -100,10 +100,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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,34 +702,47 @@  discard block
 block discarded – undo
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) {
678 711
                 $rdf .= "\t<sioc:has_creator>\n";
679 712
                 $rdf .= "\t\t<sioc:UserAccount rdf:about=\"" . clean($this->_creator->_uri) ."\">\n";
680
-                if($this->_creator->_sioc_url) { $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"". $this->_creator->_sioc_url ."\"/>\n"; }
681
-                else $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('user', $this->_creator->_id). "\"/>\n";
713
+                if($this->_creator->_sioc_url) { $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"". $this->_creator->_sioc_url ."\"/>\n"; } else {
714
+                  $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('user', $this->_creator->_id). "\"/>\n";
715
+                }
682 716
                 $rdf .= "\t\t</sioc:UserAccount>\n";
683 717
                 $rdf .= "\t</sioc:has_creator>\n";
684 718
                 $rdf .= "\t<foaf:maker>\n";
685 719
                 $rdf .= "\t\t<foaf:Person rdf:about=\"" . clean($this->_creator->_foaf_uri) ."\">\n";
686
-                if($this->_creator->_foaf_url) { $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"". $this->_creator->_foaf_url ."\"/>\n"; }
687
-                else $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('user', $this->_creator->_id). "\"/>\n";
720
+                if($this->_creator->_foaf_url) { $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"". $this->_creator->_foaf_url ."\"/>\n"; } else {
721
+                  $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"" . $exp->siocURL('user', $this->_creator->_id). "\"/>\n";
722
+                }
688 723
                 $rdf .= "\t\t</foaf:Person>\n";
689 724
                 $rdf .= "\t</foaf:maker>\n";
690 725
             } else {
691 726
                 $rdf .= "\t<foaf:maker>\n";
692 727
                 $rdf .= "\t\t<foaf:Person";
693
-                if($this->_creator->_name) $rdf .= " foaf:name=\"" . $this->_creator->_name ."\"";
694
-                if($this->_creator->_sha1) $rdf .= " foaf:mbox_sha1sum=\"" . $this->_creator->_sha1 ."\"";
695
-                if($this->_creator->_name) $rdf .= ">\n\t\t\t<foaf:homepage rdf:resource=\"" . $this->_creator->_homepage ."\"/>\n\t\t</foaf:Person>\n";
696
-                else $rdf .= "/>\n";
728
+                if($this->_creator->_name) {
729
+                  $rdf .= " foaf:name=\"" . $this->_creator->_name ."\"";
730
+                }
731
+                if($this->_creator->_sha1) {
732
+                  $rdf .= " foaf:mbox_sha1sum=\"" . $this->_creator->_sha1 ."\"";
733
+                }
734
+                if($this->_creator->_name) {
735
+                  $rdf .= ">\n\t\t\t<foaf:homepage rdf:resource=\"" . $this->_creator->_homepage ."\"/>\n\t\t</foaf:Person>\n";
736
+                } else {
737
+                  $rdf .= "/>\n";
738
+                }
697 739
                 $rdf .= "\t</foaf:maker>\n";
698 740
             }
699 741
         }
700 742
         $rdf .= "\t<dcterms:created>" . $this->_created . "</dcterms:created>\n";
701
-        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
+        }
702 746
         $rdf .= "\t<sioc:content>" . pureContent($this->_content) . "</sioc:content>\n";
703 747
 			
704 748
         $rdf .= "\t<content:encoded><![CDATA[" . $this->_encoded . "]]></content:encoded>\n";
@@ -792,8 +836,9 @@  discard block
 block discarded – undo
792 836
         if ($this->_subject)
793 837
         {
794 838
             $rdf .= "\t<dc:title>" . clean($this->_subject) . "</dc:title>\n";
795
-            if(strcmp($this->_has_container, 'http://en.wikipedia.org')===0)
796
-                $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
+            }
797 842
         }
798 843
         if ($this->_creator->_nick) {
799 844
             /*if ($this->_creator->_id) {
@@ -814,7 +859,9 @@  discard block
 block discarded – undo
814 859
                 $rdf .= "\t\t<sioc:UserAccount rdf:about=\"" . clean($this->_creator->_uri) ."\">\n";
815 860
                 $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"" .
816 861
                         clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki='.$this->_creator->_uri);
817
-                if ($this->_api) $rdf .= clean("&api=" . $this->_api);
862
+                if ($this->_api) {
863
+                  $rdf .= clean("&api=" . $this->_api);
864
+                }
818 865
                 $rdf .= "\"/>\n";
819 866
                 $rdf .= "\t\t</sioc:UserAccount>\n";
820 867
                 $rdf .= "\t</sioc:has_creator>\n";
@@ -845,7 +892,9 @@  discard block
 block discarded – undo
845 892
                 $rdf .= "\t\t<sioct:Category rdf:about=\"" . clean($url) ."\">\n";
846 893
                 $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"" .
847 894
                         clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki='.$url);
848
-                if ($this->_api) $rdf .= clean("&api=" . $this->_api);
895
+                if ($this->_api) {
896
+                  $rdf .= clean("&api=" . $this->_api);
897
+                }
849 898
                 $rdf .= "\"/>\n";
850 899
                 $rdf .= "\t\t</sioct:Category>\n";
851 900
                 $rdf .= "\t</sioc:topic>\n";
@@ -857,7 +906,9 @@  discard block
 block discarded – undo
857 906
                 $rdf .= "\t\t<sioct:WikiArticle rdf:about=\"" . clean($url) ."\">\n";
858 907
                 $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"" .
859 908
                         clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki='.$url);
860
-                if ($this->_api) $rdf .= clean("&api=" . $this->_api);
909
+                if ($this->_api) {
910
+                  $rdf .= clean("&api=" . $this->_api);
911
+                }
861 912
                 $rdf .= "\"/>\n";
862 913
                 $rdf .= "\t\t</sioct:WikiArticle>\n";
863 914
                 $rdf .= "\t</sioc:links_to>\n";
@@ -869,7 +920,9 @@  discard block
 block discarded – undo
869 920
                 $rdf .= "\t\t<sioct:WikiArticle rdf:about=\"" . clean($this->_links) ."\">\n";
870 921
                 $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"" .
871 922
                         clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki='.$this->_links);
872
-                if ($this->_api) $rdf .= clean("&api=" . $this->_api);
923
+                if ($this->_api) {
924
+                  $rdf .= clean("&api=" . $this->_api);
925
+                }
873 926
                 $rdf .= "\"/>\n";
874 927
                 $rdf .= "\t\t</sioct:WikiArticle>\n";
875 928
                 $rdf .= "\t</sioc:links_to>\n";
@@ -885,7 +938,9 @@  discard block
 block discarded – undo
885 938
                 $rdf .= "\t\t<sioct:WikiArticle rdf:about=\"" . clean($this->_previous_version) ."\">\n";
886 939
                 $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"" .
887 940
                         clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki='.$this->_previous_version);
888
-                if ($this->_api) $rdf .= clean("&api=" . $this->_api);
941
+                if ($this->_api) {
942
+                  $rdf .= clean("&api=" . $this->_api);
943
+                }
889 944
                 $rdf .= "\"/>\n";
890 945
                 $rdf .= "\t\t</sioct:WikiArticle>\n";
891 946
                 $rdf .= "\t</sioc:previous_version>\n";
@@ -905,7 +960,9 @@  discard block
 block discarded – undo
905 960
                 $rdf .= "\t\t<sioct:WikiArticle rdf:about=\"" . clean($this->_next_version) ."\">\n";
906 961
                 $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"" .
907 962
                         clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki='.$this->_next_version);
908
-                if ($this->_api) $rdf .= clean("&api=" . $this->_api);
963
+                if ($this->_api) {
964
+                  $rdf .= clean("&api=" . $this->_api);
965
+                }
909 966
                 $rdf .= "\"/>\n";
910 967
                 $rdf .= "\t\t</sioct:WikiArticle>\n";
911 968
                 $rdf .= "\t</sioc:next_version>\n";
@@ -925,7 +982,9 @@  discard block
 block discarded – undo
925 982
                 $rdf .= "\t\t<sioct:WikiArticle rdf:about=\"" . clean($this->_latest_version) ."\">\n";
926 983
                 $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"" .
927 984
                         clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki='.$this->_latest_version);
928
-                if ($this->_api) $rdf .= clean("&api=" . $this->_api);
985
+                if ($this->_api) {
986
+                  $rdf .= clean("&api=" . $this->_api);
987
+                }
929 988
                 $rdf .= "\"/>\n";
930 989
                 $rdf .= "\t\t</sioct:WikiArticle>\n";
931 990
                 $rdf .= "\t</sioc:latest_version>\n";
@@ -935,7 +994,9 @@  discard block
 block discarded – undo
935 994
                 $rdf .= "\t\t<sioct:WikiArticle rdf:about=\"" . clean($this->_has_discussion) ."\">\n";
936 995
                 $rdf .= "\t\t\t<rdfs:seeAlso rdf:resource=\"" .
937 996
                         clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki='.$this->_has_discussion);
938
-                if ($this->_api) $rdf .= clean("&api=" . $this->_api);
997
+                if ($this->_api) {
998
+                  $rdf .= clean("&api=" . $this->_api);
999
+                }
939 1000
                 $rdf .= "\"/>\n";
940 1001
                 $rdf .= "\t\t</sioct:WikiArticle>\n";
941 1002
                 $rdf .= "\t</sioc:has_discussion>\n";
@@ -950,7 +1011,9 @@  discard block
 block discarded – undo
950 1011
             $rdf .= "\t<owl:sameAs rdf:resource=\"" . clean($this->_redirpage) ."\"/>\n";
951 1012
             $rdf .= "\t<rdfs:seeAlso rdf:resource=\"" . 
952 1013
                         clean('http://ws.sioc-project.org/mediawiki/mediawiki.php?wiki='.$this->_redirpage);
953
-            if ($this->_api) $rdf .= clean("&api=" . $this->_api);
1014
+            if ($this->_api) {
1015
+              $rdf .= clean("&api=" . $this->_api);
1016
+            }
954 1017
             $rdf .= "\"/>\n";
955 1018
         }
956 1019
 
@@ -1013,7 +1076,9 @@  discard block
 block discarded – undo
1013 1076
 #    return htmlentities2( $text );
1014 1077
     // double encoding is preventable now
1015 1078
     // $text = htmlspecialchars_decode($text, ENT_COMPAT);
1016
-    if ($url) $text = str_replace('&amp;','&', $text);
1079
+    if ($url) {
1080
+      $text = str_replace('&amp;','&', $text);
1081
+    }
1017 1082
     return htmlspecialchars($text, ENT_COMPAT, 'UTF-8');
1018 1083
   }
1019 1084
 }
Please login to merge, or discard this patch.
action.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
     /* -- Methods to manage plugin ------------------------------------------ */
81 81
 
82 82
     /**
83
-    * Register its handlers with the DokuWiki's event controller
84
-    */
83
+     * Register its handlers with the DokuWiki's event controller
84
+     */
85 85
     public function register(Doku_Event_Handler $controller)
86 86
     {
87 87
         //print_r(headers_list()); die();
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
     }
147 147
     
148 148
     /**
149
-    */
149
+     */
150 150
     public function createRdfLink($event = null, $param = null)
151 151
     {
152 152
         global $ID, $INFO, $conf;
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
 
501 501
         // create container object
502 502
         $wikicontainer = new SIOCDokuWikiContainer($ID,
503
-                                                   normalizeUri($exporter->siocURL('container', $ID))
503
+                                                    normalizeUri($exporter->siocURL('container', $ID))
504 504
                                                   );
505 505
 
506 506
         /* container is type=wiki */ if ($ID == $conf['start']) $wikicontainer->isWiki();
@@ -563,10 +563,10 @@  discard block
 block discarded – undo
563 563
         // create user object
564 564
         //print_r($userinfo); die();
565 565
         $wikiuser = new SIOCDokuWikiUser($ID,
566
-                                         normalizeUri($exporter->siocURL('user', $ID)),
567
-                                         $userid,
568
-                                         $userinfo['name'],
569
-                                         $userinfo['mail']);
566
+                                          normalizeUri($exporter->siocURL('user', $ID)),
567
+                                          $userid,
568
+                                          $userinfo['name'],
569
+                                          $userinfo['mail']);
570 570
         /* TODO: avatar (using Gravatar) */
571 571
         /* TODO: creator_of */
572 572
         // add user to exporter
Please login to merge, or discard this patch.
Braces   +121 added lines, -74 removed lines patch added patch discarded remove patch
@@ -68,8 +68,12 @@  discard block
 block discarded – undo
68 68
  * - proof of concept release under CC-BY-SA
69 69
  **/
70 70
  
71
-if(!defined('DOKU_INC')) die();
72
-if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
71
+if(!defined('DOKU_INC')) {
72
+  die();
73
+}
74
+if(!defined('DOKU_PLUGIN')) {
75
+  define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
76
+}
73 77
 require_once(DOKU_PLUGIN.'action.php');
74 78
  
75 79
 class action_plugin_dokusioc extends DokuWiki_Action_Plugin {
@@ -89,7 +93,9 @@  discard block
 block discarded – undo
89 93
         // test the requested action
90 94
         $controller->register_hook('ACTION_ACT_PREPROCESS', 'BEFORE',  $this, 'checkAction', $controller);
91 95
         // pingthesemanticweb.com
92
-        if ($this->getConf('pingsw')) $controller->register_hook('ACTION_SHOW_REDIRECT', 'BEFORE',  $this, 'pingService', $controller);
96
+        if ($this->getConf('pingsw')) {
97
+          $controller->register_hook('ACTION_SHOW_REDIRECT', 'BEFORE',  $this, 'pingService', $controller);
98
+        }
93 99
     }
94 100
  
95 101
     /* -- Event handlers ---------------------------------------------------- */
@@ -104,18 +110,18 @@  discard block
 block discarded – undo
104 110
         {
105 111
             // give back rdf
106 112
             $this->exportSioc();
107
-        }
108
-        elseif (($action->data == 'show' || $action->data == 'index') && $INFO['perm'] && !defined('DOKU_MEDIADETAIL') && ($INFO['exists'] || getDwUserInfo($INFO['id'],$this)) && !isHiddenPage($INFO['id']))
113
+        } elseif (($action->data == 'show' || $action->data == 'index') && $INFO['perm'] && !defined('DOKU_MEDIADETAIL') && ($INFO['exists'] || getDwUserInfo($INFO['id'],$this)) && !isHiddenPage($INFO['id']))
109 114
         {
110 115
             if ($this->isRdfXmlRequest())
111 116
             {
112 117
                 // forward to rdfxml document if requested
113 118
                 // print_r(headers_list()); die();
114 119
                 $location = $this->createRdfLink();
115
-                if (function_exists('header_remove')) header_remove();
120
+                if (function_exists('header_remove')) {
121
+                  header_remove();
122
+                }
116 123
                 header('Location: '.$location['href'], true, 303); exit();
117
-            }
118
-            else
124
+            } else
119 125
             {
120 126
                 // add meta link to html head
121 127
                 $controller->register_hook('TPL_METAHEADER_OUTPUT', 'BEFORE',  $this, 'createRdfLink');
@@ -153,8 +159,9 @@  discard block
 block discarded – undo
153 159
         
154 160
         // Test for hidden pages
155 161
         
156
-        if (isHiddenPage($ID))
157
-            return false;
162
+        if (isHiddenPage($ID)) {
163
+                    return false;
164
+        }
158 165
         
159 166
         // Get type of SIOC content
160 167
         
@@ -162,13 +169,16 @@  discard block
 block discarded – undo
162 169
         
163 170
         // Test for valid types
164 171
         
165
-        if (!(($sioc_type == 'post' && $INFO['exists']) || $sioc_type == 'user' || $sioc_type == 'container'))
166
-            return false;
172
+        if (!(($sioc_type == 'post' && $INFO['exists']) || $sioc_type == 'user' || $sioc_type == 'container')) {
173
+                    return false;
174
+        }
167 175
         
168 176
         // Test for permission
169 177
         
170
-        if (!$INFO['perm']) // not enough rights to see the wiki page
178
+        if (!$INFO['perm']) {
179
+          // not enough rights to see the wiki page
171 180
             return false;
181
+        }
172 182
 
173 183
         $userinfo = getDwUserInfo($ID, $this);
174 184
         
@@ -193,8 +203,9 @@  discard block
 block discarded – undo
193 203
             default:
194 204
                 $title = htmlentities("Article '".$INFO['meta']['title']."' (SIOC document as RDF/XML)");
195 205
                 $queryAttr =  array('type'=>'post');
196
-                if (isset($_GET['rev']) && $_GET['rev'] == intval($_GET['rev']))
197
-                    $queryAttr['rev'] = $_GET['rev'];
206
+                if (isset($_GET['rev']) && $_GET['rev'] == intval($_GET['rev'])) {
207
+                                    $queryAttr['rev'] = $_GET['rev'];
208
+                }
198 209
                 break;
199 210
         }
200 211
     
@@ -206,8 +217,9 @@  discard block
 block discarded – undo
206 217
             $event->data['link'][] = $metalink;
207 218
             
208 219
             // set canocial link for type URIs to prevent indexing double content
209
-            if ($_GET['type'])
210
-                $event->data['link'][] = array('rel'=>'canonical', 'href'=>getAbsUrl(wl($ID)));
220
+            if ($_GET['type']) {
221
+                            $event->data['link'][] = array('rel'=>'canonical', 'href'=>getAbsUrl(wl($ID)));
222
+            }
211 223
         }
212 224
         
213 225
         return $metalink;
@@ -221,8 +233,9 @@  discard block
 block discarded – undo
221 233
         
222 234
         // Test for hidden pages
223 235
         
224
-        if (isHiddenPage($ID))
225
-            $this->_exit("HTTP/1.0 404 Not Found");
236
+        if (isHiddenPage($ID)) {
237
+                    $this->_exit("HTTP/1.0 404 Not Found");
238
+        }
226 239
         
227 240
         // Get type of SIOC content
228 241
         
@@ -230,16 +243,21 @@  discard block
 block discarded – undo
230 243
         
231 244
         // Test for valid types
232 245
         
233
-        if (!(($sioc_type == 'post' && $INFO['exists']) || $sioc_type == 'user' || $sioc_type == 'container'))
234
-            $this->_exit("HTTP/1.0 404 Not Found");
246
+        if (!(($sioc_type == 'post' && $INFO['exists']) || $sioc_type == 'user' || $sioc_type == 'container')) {
247
+                    $this->_exit("HTTP/1.0 404 Not Found");
248
+        }
235 249
         
236 250
         // Test for permission
237 251
         
238
-        if (!$INFO['perm']) // not enough rights to see the wiki page
252
+        if (!$INFO['perm']) {
253
+          // not enough rights to see the wiki page
239 254
             $this->_exit("HTTP/1.0 401 Unauthorized");
255
+        }
240 256
 
241 257
         // Forward to URI with explicit type attribut
242
-        if (!isset($_GET['type'])) header('Location:'.$_SERVER['REQUEST_URI'].'&type='.$sioc_type, true, 302);
258
+        if (!isset($_GET['type'])) {
259
+          header('Location:'.$_SERVER['REQUEST_URI'].'&type='.$sioc_type, true, 302);
260
+        }
243 261
 
244 262
         // Include SIOC libs
245 263
         
@@ -271,8 +289,9 @@  discard block
 block discarded – undo
271 289
         }
272 290
     
273 291
         // export
274
-        if ($this->getConf('noindx')) 
275
-            header("X-Robots-Tag: noindex", true);
292
+        if ($this->getConf('noindx')) {
293
+                    header("X-Robots-Tag: noindex", true);
294
+        }
276 295
         $rdf->export();
277 296
         
278 297
         //print_r(headers_list()); die();
@@ -317,8 +336,7 @@  discard block
 block discarded – undo
317 336
                 if (count($formatspec)==2)
318 337
                 {
319 338
                     $test_accept[$k] = trim($formatspec[1]);
320
-                }
321
-                else
339
+                } else
322 340
                 {
323 341
                     $test_accept[$k] = 'q=1.0';
324 342
                 }
@@ -353,18 +371,15 @@  discard block
 block discarded – undo
353 371
             if ($userinfo)
354 372
             {
355 373
                 $type = 'user';
356
-            }
357
-            elseif (isset($_GET['do']) && $_GET['do'] == 'index')
374
+            } elseif (isset($_GET['do']) && $_GET['do'] == 'index')
358 375
             {
359 376
                 $type = 'container';
360
-            }
361
-            else
377
+            } else
362 378
             {
363 379
                 $type = 'post';
364 380
             }
365 381
             
366
-        }
367
-        else
382
+        } else
368 383
         {
369 384
             $type = $_GET['type'];
370 385
         }
@@ -408,10 +423,18 @@  discard block
 block discarded – undo
408 423
                                             rawWiki($ID,$REV) // body (content)
409 424
                                             );
410 425
         /* encoded content   */ $wikipage->addContentEncoded(p_cached_output(wikiFN($ID,$REV),'xhtml'));
411
-        /* created           */ if (isset($INFO['meta']['date']['created'])) $wikipage->addCreated(date('c', $INFO['meta']['date']['created']));
412
-        /* or modified       */ if (isset($INFO['meta']['date']['modified'])) $wikipage->addModified(date('c', $INFO['meta']['date']['modified']));
413
-        /* creator/modifier  */ if ($INFO['editor'] && $this->getConf('userns')) $wikipage->addCreator(array('foaf:maker'=>'#'.$INFO['editor'],'sioc:modifier'=>$dwuserpage_id));
414
-        /* is creator        */ if (isset($INFO['meta']['date']['created'])) $wikipage->isCreator();
426
+        /* created           */ if (isset($INFO['meta']['date']['created'])) {
427
+          $wikipage->addCreated(date('c', $INFO['meta']['date']['created']));
428
+        }
429
+        /* or modified       */ if (isset($INFO['meta']['date']['modified'])) {
430
+          $wikipage->addModified(date('c', $INFO['meta']['date']['modified']));
431
+        }
432
+        /* creator/modifier  */ if ($INFO['editor'] && $this->getConf('userns')) {
433
+          $wikipage->addCreator(array('foaf:maker'=>'#'.$INFO['editor'],'sioc:modifier'=>$dwuserpage_id));
434
+        }
435
+        /* is creator        */ if (isset($INFO['meta']['date']['created'])) {
436
+          $wikipage->isCreator();
437
+        }
415 438
         /* intern wiki links */ $wikipage->addLinks($INFO['meta']['relation']['references']);
416 439
         
417 440
         // contributors - only for last revision b/c of wrong meta data for older revisions
@@ -419,8 +442,9 @@  discard block
 block discarded – undo
419 442
         {
420 443
             $cont_temp = array();
421 444
             $cont_ns = $this->getConf('userns').($conf['useslash']?'/':':');
422
-            foreach($INFO['meta']['contributor'] as $cont_id => $cont_name)
423
-                $cont_temp[$cont_ns.$cont_id] = $cont_name;
445
+            foreach($INFO['meta']['contributor'] as $cont_id => $cont_name) {
446
+                            $cont_temp[$cont_ns.$cont_id] = $cont_name;
447
+            }
424 448
             $wikipage->addContributors($cont_temp);
425 449
         }
426 450
         
@@ -429,7 +453,9 @@  discard block
 block discarded – undo
429 453
         {
430 454
             require_once(DOKU_INC.'inc/fulltext.php');
431 455
             $backlinks = ft_backlinks($ID);
432
-            if (count($backlinks) > 0) $wikipage->addBacklinks($backlinks);
456
+            if (count($backlinks) > 0) {
457
+              $wikipage->addBacklinks($backlinks);
458
+            }
433 459
         }
434 460
         
435 461
         // TODO: addLinksExtern
@@ -442,8 +468,7 @@  discard block
 block discarded – undo
442 468
         {
443 469
             // latest revision, previous rev is on top in array
444 470
             $prevrev = 0;
445
-        }
446
-        else
471
+        } else
447 472
         {
448 473
             // other revision
449 474
             $currentrev = array_search($REV, $pagerevs);
@@ -453,15 +478,23 @@  discard block
 block discarded – undo
453 478
                 $nextrev = $currentrev - 1;
454 479
             }
455 480
         }
456
-        if ($prevrev !== false && $prevrev > -1 && page_exists($ID,$pagerevs[$prevrev]))
457
-        /* previous revision*/ $wikipage->addVersionPrevious($pagerevs[$prevrev]);
458
-        if ($nextrev !== false && $nextrev > -1 && page_exists($ID,$pagerevs[$nextrev]))
459
-        /* next revision*/ $wikipage->addVersionNext($pagerevs[$nextrev]);
481
+        if ($prevrev !== false && $prevrev > -1 && page_exists($ID,$pagerevs[$prevrev])) {
482
+                /* previous revision*/ $wikipage->addVersionPrevious($pagerevs[$prevrev]);
483
+        }
484
+        if ($nextrev !== false && $nextrev > -1 && page_exists($ID,$pagerevs[$nextrev])) {
485
+                /* next revision*/ $wikipage->addVersionNext($pagerevs[$nextrev]);
486
+        }
460 487
 
461
-        /* latest revision   */ if ($REV) $wikipage->addVersionLatest();
488
+        /* latest revision   */ if ($REV) {
489
+          $wikipage->addVersionLatest();
490
+        }
462 491
         // TODO: topics
463
-        /* has_container     */ if ($INFO['namespace']) $wikipage->addContainer($INFO['namespace']); 
464
-        /* has_space         */ if ($this->getConf('owners')) $wikipage->addSite($this->getConf('owners')); 
492
+        /* has_container     */ if ($INFO['namespace']) {
493
+          $wikipage->addContainer($INFO['namespace']);
494
+        }
495
+        /* has_space         */ if ($this->getConf('owners')) {
496
+          $wikipage->addSite($this->getConf('owners'));
497
+        }
465 498
         // TODO: dc:contributor / has_modifier
466 499
         // TODO: attachment (e.g. pictures in that dwns)
467 500
         
@@ -480,12 +513,10 @@  discard block
 block discarded – undo
480 513
         if ($ID == $conf['start'])
481 514
         {
482 515
             $title = $conf['title'];
483
-        }
484
-        elseif (isset($INFO['meta']['title']))
516
+        } elseif (isset($INFO['meta']['title']))
485 517
         {
486 518
             $title = $INFO['meta']['title'];
487
-        }
488
-        else
519
+        } else
489 520
         {
490 521
             $title = $ID;
491 522
         }
@@ -503,9 +534,15 @@  discard block
 block discarded – undo
503 534
                                                    normalizeUri($exporter->siocURL('container', $ID))
504 535
                                                   );
505 536
 
506
-        /* container is type=wiki */ if ($ID == $conf['start']) $wikicontainer->isWiki();
507
-        /* sioc:name              */ if ($INFO['exists']) $wikicontainer->addTitle($INFO['meta']['title']);
508
-        /* has_parent             */ if ($INFO['namespace']) $wikicontainer->addParent($INFO['namespace']); 
537
+        /* container is type=wiki */ if ($ID == $conf['start']) {
538
+          $wikicontainer->isWiki();
539
+        }
540
+        /* sioc:name              */ if ($INFO['exists']) {
541
+          $wikicontainer->addTitle($INFO['meta']['title']);
542
+        }
543
+        /* has_parent             */ if ($INFO['namespace']) {
544
+          $wikicontainer->addParent($INFO['namespace']);
545
+        }
509 546
 
510 547
         // search next level entries (posts, sub containers) in container
511 548
         require_once(DOKU_INC.'inc/search.php');
@@ -520,8 +557,7 @@  discard block
 block discarded – undo
520 557
             {
521 558
                 // wikisite
522 559
                 $posts[] = $entry;
523
-            }
524
-            elseif($entry['type'] === 'd')
560
+            } elseif($entry['type'] === 'd')
525 561
             {
526 562
                 // sub container
527 563
                 $containers[] = $entry;
@@ -529,11 +565,16 @@  discard block
 block discarded – undo
529 565
         }
530 566
         
531 567
         // without sub content it can't be a container (so it does not exist as a container)
532
-        if (count($posts) + count($containers) == 0)
533
-            $this->_exit("HTTP/1.0 404 Not Found");
568
+        if (count($posts) + count($containers) == 0) {
569
+                    $this->_exit("HTTP/1.0 404 Not Found");
570
+        }
534 571
         
535
-        if (count($posts)>0) $wikicontainer->addArticles($posts);
536
-        if (count($containers)>0) $wikicontainer->addContainers($containers);
572
+        if (count($posts)>0) {
573
+          $wikicontainer->addArticles($posts);
574
+        }
575
+        if (count($containers)>0) {
576
+          $wikicontainer->addContainers($containers);
577
+        }
537 578
 
538 579
         //print_r($containers);die();
539 580
         
@@ -551,8 +592,9 @@  discard block
 block discarded – undo
551 592
         $userinfo = getDwUserInfo($ID,$this);
552 593
         
553 594
         // no userinfo means there is n user space or user does not exists
554
-        if ($userinfo === false)
555
-            $this->_exit("HTTP/1.0 404 Not Found");
595
+        if ($userinfo === false) {
596
+                    $this->_exit("HTTP/1.0 404 Not Found");
597
+        }
556 598
         
557 599
         $exporter->setParameters('Account: '.$userinfo['name'],
558 600
                             getAbsUrl(),
@@ -589,7 +631,9 @@  discard block
 block discarded – undo
589 631
     
590 632
     private function _getDate($date, $date_alt=null)
591 633
     {
592
-        if (!$date) $date = $date_alt;
634
+        if (!$date) {
635
+          $date = $date_alt;
636
+        }
593 637
         return date('c',$date);
594 638
     }
595 639
     
@@ -599,7 +643,9 @@  discard block
 block discarded – undo
599 643
 {
600 644
     function getAbsUrl($url=null)
601 645
     {
602
-        if ($url == null) $url = DOKU_BASE;
646
+        if ($url == null) {
647
+          $url = DOKU_BASE;
648
+        }
603 649
         return str_replace(DOKU_BASE, DOKU_URL, $url);
604 650
     }
605 651
 }
@@ -612,8 +658,7 @@  discard block
 block discarded – undo
612 658
         if ($info = $auth->getUserData($user))
613 659
         {
614 660
             return $info['mail'];
615
-        }
616
-        else
661
+        } else
617 662
         {
618 663
             return false;
619 664
         }
@@ -626,7 +671,9 @@  discard block
 block discarded – undo
626 671
     {
627 672
         global $auth, $conf;
628 673
         
629
-        if (!$pobj->getConf('userns')) return false;
674
+        if (!$pobj->getConf('userns')) {
675
+          return false;
676
+        }
630 677
         
631 678
         // get user id
632 679
         $userid = str_replace(cleanID($pobj->getConf('userns')).($conf['useslash']?'/':':'),'',$id);
@@ -636,13 +683,11 @@  discard block
 block discarded – undo
636 683
             if ($key)
637 684
             {
638 685
                 return $info['key'];
639
-            }
640
-            else
686
+            } else
641 687
             {
642 688
                 return $info;
643 689
             }
644
-        }
645
-        else
690
+        } else
646 691
         {
647 692
             return false;
648 693
         }
@@ -664,7 +709,9 @@  discard block
 block discarded – undo
664 709
             
665 710
             // test separator
666 711
             $sep = '&';
667
-            if (strpos($query, '&amp;') !== false) $sep = '&amp;';
712
+            if (strpos($query, '&amp;') !== false) {
713
+              $sep = '&amp;';
714
+            }
668 715
             $attr = explode($sep, $query);
669 716
             
670 717
             sort($attr);
Please login to merge, or discard this patch.