[Fusionforge-commits] FusionForge branch master updated. 001b848981412358abb9a1f4eabab91a1466d974

Alain Peyrat aljeux at fusionforge.org
Tue Sep 17 10:54:52 CEST 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, master has been updated
       via  001b848981412358abb9a1f4eabab91a1466d974 (commit)
       via  35ad2ae997563d4a7c2a1e4d2905b083f73125ba (commit)
       via  2157e725da67f038cb31d81535598f3f9699de50 (commit)
       via  ed81bf462eb90cf20785bf6d0c21c7dacd68b0d9 (commit)
      from  0ecaaf9dd15baf7e3cd8ff1d1b3f6b56e2fcdeb3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 001b848981412358abb9a1f4eabab91a1466d974
Author: Alain Peyrat <alain.peyrat at alcatel-lucent.com>
Date:   Tue Sep 17 10:54:39 2013 +0200

    Update PHP Doc mostly

diff --git a/src/common/pm/Validator.class.php b/src/common/pm/Validator.class.php
index ea51c2a..40541e9 100644
--- a/src/common/pm/Validator.class.php
+++ b/src/common/pm/Validator.class.php
@@ -62,8 +62,8 @@ class Validator {
 	/**
 	* Returns an error message which contains the null field names which have been checked
 	*
-	* @param preamble string - A string with which to start the error message
-	* @return string - A complete error message
+	* @param	string	$preamble - A string with which to start the error message
+	* @return	string - A complete error message
 	*/
 	function formErrorMsg($preamble) {
 		foreach ($this->badfields as $field) {
diff --git a/src/common/reporting/ReportTrackerAct.class.php b/src/common/reporting/ReportTrackerAct.class.php
index ecee14d..a01eba5 100644
--- a/src/common/reporting/ReportTrackerAct.class.php
+++ b/src/common/reporting/ReportTrackerAct.class.php
@@ -59,14 +59,14 @@ function ReportTrackerAct($span,$group_id,$atid,$start=0,$end=0) {
 		$this->setError('No group_id');
 		return false;
 	}
-	
+
 	switch ($span) {
 		case REPORT_TYPE_WEEKLY: {
-			$arr =& $this->getWeekStartArr();
+			$arr = $this->getWeekStartArr();
 			break;
 		}
 		default: {
-			$arr =& $this->getMonthStartArr();
+			$arr = $this->getMonthStartArr();
 			break;
 		}
 	}
diff --git a/src/common/search/FrsSearchQuery.class.php b/src/common/search/FrsSearchQuery.class.php
index 2796cae..67037a2 100644
--- a/src/common/search/FrsSearchQuery.class.php
+++ b/src/common/search/FrsSearchQuery.class.php
@@ -44,11 +44,12 @@ class FrsSearchQuery extends SearchQuery {
 	/**
 	 * Constructor
 	 *
-	 * @param string $words words we are searching for
-	 * @param int $offset offset
-	 * @param boolean $isExact if we want to search for all the words or if only one matching the query is sufficient
-	 * @param int $groupId group id
-	 * @param array $sections sections to search in
+	 * @param string	$words words we are searching for
+	 * @param int		$offset offset
+	 * @param bool		$isExact if we want to search for all the words or if only one matching the query is sufficient
+	 * @param int		$groupId group id
+	 * @param string	$sections sections to search in
+	 * @param bool		$showNonPublic
 	 */
 	function __construct($words, $offset, $isExact, $groupId, $sections=SEARCH__ALL_SECTIONS, $showNonPublic=false) {
 		$this->groupId = $groupId;

commit 35ad2ae997563d4a7c2a1e4d2905b083f73125ba
Author: Alain Peyrat <alain.peyrat at alcatel-lucent.com>
Date:   Tue Sep 17 10:54:22 2013 +0200

    Secure date range to 2037 max to avoid integer overflow

diff --git a/src/common/tracker/ArtifactQuery.class.php b/src/common/tracker/ArtifactQuery.class.php
index 2bd5faf..d6a7435 100644
--- a/src/common/tracker/ArtifactQuery.class.php
+++ b/src/common/tracker/ArtifactQuery.class.php
@@ -570,7 +570,7 @@ class ArtifactQuery extends Error {
 	function getOpenDateRange() {
 		if (!isset($this->element_array))
 			return false;
-		if ($this->element_array[ARTIFACT_QUERY_OPENDATE][0]) {
+		if (isset($this->element_array[ARTIFACT_QUERY_OPENDATE][0])) {
 			return $this->element_array[ARTIFACT_QUERY_OPENDATE][0];
 		} else {
 			return false;
@@ -585,7 +585,7 @@ class ArtifactQuery extends Error {
 	function getCloseDateRange() {
 		if (!isset($this->element_array))
 			return false;
-		if ($this->element_array[ARTIFACT_QUERY_CLOSEDATE][0]) {
+		if (isset($this->element_array[ARTIFACT_QUERY_CLOSEDATE][0])) {
 			return $this->element_array[ARTIFACT_QUERY_CLOSEDATE][0];
 		} else {
 			return false;
@@ -681,8 +681,20 @@ class ArtifactQuery extends Error {
 	 * @param string $daterange A range of two dates (1999-05-01 1999-06-01)
 	 * @return bool true/false.
 	 */
-	function validateDateRange($daterange) {
-		return preg_match('/[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{4}-[0-9]{2}-[0-9]{2}/',$daterange);
+	function validateDateRange(&$daterange) {
+		if(! preg_match('/([0-9]{4})-[0-9]{2}-[0-9]{2} ([0-9]{4})-[0-9]{2}-[0-9]{2}/', $daterange, $matches)) {
+			return false;
+		}
+		else {
+			# Hack to avoid exceeding the maximum value for an integer in the database
+			if ($matches[1] > 2037) {
+				$daterange = preg_replace('/[\d]{4}(-[\d]{2}-[\d]{2} [\d]{4}-[\d]{2}-[\d]{2})/', '2037$1', $daterange);
+			}
+			if ($matches[2] > 2037) {
+				$daterange = preg_replace('/([\d]{4}-[\d]{2}-[\d]{2} )[\d]{4}(-[\d]{2}-[\d]{2})/', '${1}2037$2', $daterange);
+			}
+		}
+		return true;
 	}
 
 	/**

commit 2157e725da67f038cb31d81535598f3f9699de50
Author: Alain Peyrat <alain.peyrat at alcatel-lucent.com>
Date:   Tue Sep 17 10:53:09 2013 +0200

    Drop unused variable

diff --git a/src/common/tracker/Artifact.class.php b/src/common/tracker/Artifact.class.php
index 468506f..794b1d1 100644
--- a/src/common/tracker/Artifact.class.php
+++ b/src/common/tracker/Artifact.class.php
@@ -596,15 +596,7 @@ class Artifact extends Error {
 	 */
 	function setMonitor() {
 		if (session_loggedin()) {
-
 			$user_id=user_getid();
-			$user =& user_get_object(user_getid());
-			$email=' ';
-
-			//we don't want to include the "And email=" because
-			//a logged-in user's email may have changed
-			$email_sql='';
-
 		} else {
 			$this->setError(_('Valid Email Address Required'));
 			return false;
@@ -972,8 +964,7 @@ class Artifact extends Error {
 		//
 		//	Get a lock on this row in the database
 		//
-		$lock = db_query_params ('SELECT * FROM artifact WHERE artifact_id=$1 FOR UPDATE',
-					 array ($this->getID())) ;
+		db_query_params ('SELECT * FROM artifact WHERE artifact_id=$1 FOR UPDATE', array ($this->getID())) ;
 		$artifact_type_id = $this->ArtifactType->getID();
 		//
 		//	Attempt to move this Artifact to a new ArtifactType
@@ -1353,7 +1344,7 @@ class Artifact extends Error {
 				} elseif (($type == ARTIFACT_EXTRAFIELDTYPE_MULTISELECT) || ($type == ARTIFACT_EXTRAFIELDTYPE_CHECKBOX)) {
 					$extra_fields[$efid]=array('100');
 				} else {
-					$resdel = db_query_params ('DELETE FROM artifact_extra_field_data WHERE artifact_id=$1 AND extra_field_id=$2',
+					db_query_params ('DELETE FROM artifact_extra_field_data WHERE artifact_id=$1 AND extra_field_id=$2',
 								   array ($this->getID(),
 									  $efid)) ;
 					continue;

commit ed81bf462eb90cf20785bf6d0c21c7dacd68b0d9
Author: Alain Peyrat <alain.peyrat at alcatel-lucent.com>
Date:   Mon Sep 16 15:41:20 2013 +0200

    Drop unused variables & less strings

diff --git a/src/www/include/features_boxes.php b/src/www/include/features_boxes.php
index 8e816c1..c19bfa8 100644
--- a/src/www/include/features_boxes.php
+++ b/src/www/include/features_boxes.php
@@ -71,9 +71,6 @@ function show_top_downloads() {
 	//      to allow download list to be cached before nightly
 	//      aggregation is done. jbyers 2001.03.19
 	//
-	$month = date("Ym",time()-(2*3600*24));
-	$day = date("d",time()-(2*3600*24));
-
 	$return = '' ;
 
 	$res_topdown = db_query_params ('
@@ -106,7 +103,7 @@ function show_top_downloads() {
 		}
 	}
 	if ( $return == "" ) {
-		return _('No Stats Available');
+		return _('No stats available');
 	} else {
 		$return = '<table>' . $return . "</table>\n";
 	}
@@ -188,7 +185,7 @@ function show_newest_projects() {
 	}
 
 	if ( $return == "" ) {
-		return _('No Stats Available');
+		return _('No stats available');
 	} else {
 		$return = '<table>' . $return . "</table>\n";
 	}
@@ -208,7 +205,7 @@ function show_highest_ranked_users() {
 	} else {
 		$rows = db_numrows($res);
 		if ($rows < 1) {
-			return  _('No Stats Available');
+			return  _('No stats available');
 		} else {
 			$return = '';
 			for ($i=0; $i < $rows; $i++) {
@@ -243,7 +240,7 @@ function show_highest_ranked_projects() {
 		$count++ ;
 	}
 	if ( $return == "" ) {
-		return _('No Stats Available');
+		return _('No stats available');
 	} else {
 		$return = '<table>' . $return . "</table>\n";
 	}

-----------------------------------------------------------------------

Summary of changes:
 src/common/pm/Validator.class.php               |    4 ++--
 src/common/reporting/ReportTrackerAct.class.php |    6 +++---
 src/common/search/FrsSearchQuery.class.php      |   11 ++++++-----
 src/common/tracker/Artifact.class.php           |   13 ++-----------
 src/common/tracker/ArtifactQuery.class.php      |   20 ++++++++++++++++----
 src/www/include/features_boxes.php              |   11 ++++-------
 6 files changed, 33 insertions(+), 32 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list