[Evolvis-commits] r211: attempt to fix some “PHP Notice : Undefined index: ”↵

mirabilos at evolvis.org mirabilos at evolvis.org
Wed Nov 25 12:07:29 CET 2009


Author: mirabilos
Date: 2009-11-25 11:07:29 +0000 (Wed, 25 Nov 2009)
New Revision: 211

Modified:
   trunk/gforge_base/gforge-4.8.1+evolvis/plugins/mediawiki/mediawiki-skin/FusionForge.php
Log:
attempt to fix some “PHP Notice:  Undefined index:”


Modified: trunk/gforge_base/gforge-4.8.1+evolvis/plugins/mediawiki/mediawiki-skin/FusionForge.php
===================================================================
--- trunk/gforge_base/gforge-4.8.1+evolvis/plugins/mediawiki/mediawiki-skin/FusionForge.php	2009-11-25 10:56:39 UTC (rev 210)
+++ trunk/gforge_base/gforge-4.8.1+evolvis/plugins/mediawiki/mediawiki-skin/FusionForge.php	2009-11-25 11:07:29 UTC (rev 211)
@@ -1,4 +1,10 @@
 <?php
+// $Id$
+
+function ifsetor(&$val, $default = false) {
+	return (isset($val) ? $val : $default);
+}
+
 /**
  * FusionForge theme for Mediawiki
  */
@@ -83,7 +89,7 @@
 
 <body <?php if($this->data['body_ondblclick']) { ?>ondblclick="<?php $this->text('body_ondblclick') ?>"<?php } ?>
 <?php if($this->data['body_onload'    ]) { ?>onload="<?php     $this->text('body_onload')     ?>"<?php } ?>
- class="<?php $this->text('nsclass') ?> <?php $this->text('dir') ?>">
+ class="<?php if (ifsetor($this->data['nsclass']) { $this->text('nsclass') } ?> <?php $this->text('dir') ?>">
 
 	<div id="globalWrapper">
 		<div id="column-content">
@@ -116,11 +122,11 @@
 			$this->data['personal_urls']['logout']=array();
 			foreach($this->data['personal_urls'] as $key => $item) { ?>
 				<li id="pt-<?php echo htmlspecialchars($key) ?>"<?php
-					if ($item['active']) { ?> class="active"<?php } ?>><a href="<?php
-				echo htmlspecialchars($item['href']) ?>"<?php
+					if (ifsetor($item['active'])) { ?> class="active"<?php } ?>><a href="<?php
+				echo htmlspecialchars(ifsetor($item['href'], "")) ?>"<?php
 				if(!empty($item['class'])) { ?> class="<?php
 				echo htmlspecialchars($item['class']) ?>"<?php } ?>><?php
-				echo htmlspecialchars($item['text']) ?></a></li>
+				echo htmlspecialchars(ifsetor($item['text'], "")) ?></a></li>
 <?php			} ?>
 			</ul>
 		</div>


Property changes on: trunk/gforge_base/gforge-4.8.1+evolvis/plugins/mediawiki/mediawiki-skin/FusionForge.php
___________________________________________________________________
Name: svn:keywords
   + Author CVSHeader Date Id LastChangedBy LastChangedDate LastChangedRevision Log Revision Source State




More information about the evolvis-commits mailing list