[Fusionforge-commits] r15772 - in branches/Branch_5_1/src/common: include widget

Thorsten Glaser mirabilos at fusionforge.org
Thu Jun 14 11:13:01 CEST 2012


Author: mirabilos
Date: 2012-06-14 11:13:01 +0200 (Thu, 14 Jun 2012)
New Revision: 15772

Modified:
   branches/Branch_5_1/src/common/include/Group.class.php
   branches/Branch_5_1/src/common/widget/Widget_ProjectPublicAreas.class.php
Log:
better fix for group custom homepages, from Evolvis

Modified: branches/Branch_5_1/src/common/include/Group.class.php
===================================================================
--- branches/Branch_5_1/src/common/include/Group.class.php	2012-06-13 17:05:58 UTC (rev 15771)
+++ branches/Branch_5_1/src/common/include/Group.class.php	2012-06-14 09:13:01 UTC (rev 15772)
@@ -1555,6 +1555,11 @@
 	 *	@return	string	homepage URL.
 	 */
 	function getHomePage() {
+		if (!preg_match("/^[a-zA-Z][a-zA-Z0-9+.-]*:/",
+		    $this->data_array['homepage'])) {
+			$this->data_array['homepage'] = util_url_prefix() .
+			    $this->data_array['homepage'];
+		}
 		return $this->data_array['homepage'];
 	}
 

Modified: branches/Branch_5_1/src/common/widget/Widget_ProjectPublicAreas.class.php
===================================================================
--- branches/Branch_5_1/src/common/widget/Widget_ProjectPublicAreas.class.php	2012-06-13 17:05:58 UTC (rev 15771)
+++ branches/Branch_5_1/src/common/widget/Widget_ProjectPublicAreas.class.php	2012-06-14 09:13:01 UTC (rev 15772)
@@ -39,11 +39,9 @@
 		// ################# Homepage Link
 
 		echo '<div class="public-area-box" rel="doap:homepage">';
-		if ( util_check_url($project->getHomePage())) {
-			echo util_make_link ($project->getHomePage(), $HTML->getHomePic(_('Home Page')) . ' ' . _('Project Home Page'), false, true);
-                } else {
-			echo util_make_link ('http://' . $project->getHomePage(), $HTML->getHomePic(_('Home Page')) . ' ' . _('Project Home Page'), false, true);
-		}
+		echo util_make_link($project->getHomePage(),
+		    $HTML->getHomePic(_('Home Page')) . ' ' .
+		    _('Project Home Page'), false, true);
 		echo "</div>\n";
 
 		// ################## ArtifactTypes




More information about the Fusionforge-commits mailing list