On Wed, Feb 13, 2008 at 05:00:56AM -0600, Carlo Marcelo Arenas Belon wrote:
> On Tue, Feb 12, 2008 at 04:57:25PM -0800, Bernard Li wrote:
> > Guys:
> > 
> > I plan to check-in the following patch and release 3.0.7:
> 
> can we use the same exact code already committed in trunk (including spaces
> and other details) so that there are no unnecessary divergences in the
> maintenance branch?

attached inline the updated patch against revision 962 (which includes the
style/formatting changes needed to converge with trunk) and which corresponds
to the same fixes that were originally proposed.

the first snippet at line 11, is actually an extra change (coming from a style
fix) which corresponds better with trunk and which will help (if applied)
to reduce the noise in the patches in between branches.

Carlo
Index: web/functions.php
===================================================================
--- web/functions.php   (revision 962)
+++ web/functions.php   (working copy)
@@ -421,14 +421,10 @@
 }
 
 
#-------------------------------------------------------------------------------
-# If arg is entirely numeric, return it.  Otherwise, return null.
-function clean_number( $digit )
+# If arg is a valid number, return it.  Otherwise, return null.
+function clean_number( $value )
 {
-  $return_value = null;
-  if( ctype_digit( $digit ) ) {
-    $return_value = $digit;
-  }
-  return $return_value;
+  return is_numeric( $value ) ? $value : null;
 }
 
 
#-------------------------------------------------------------------------------
Index: web/get_context.php
===================================================================
--- web/get_context.php (revision 962)
+++ web/get_context.php (working copy)
@@ -11,7 +11,7 @@
        escapeshellcmd( clean_string( rawurldecode($_GET["G"]) ) ) : NULL;
 $hostname = isset($_GET["h"]) ?
        escapeshellcmd( clean_string( rawurldecode($_GET["h"]) ) ) : NULL;
-$range = isset( $_GET['r'] ) && in_array($_GET["r"], array_keys( $time_ranges 
) ) ?
+$range = isset( $_GET["r"] ) && in_array($_GET["r"], array_keys( $time_ranges 
) ) ?
        escapeshellcmd( rawurldecode($_GET["r"])) : NULL;
 $metricname = isset($_GET["m"]) ?
        escapeshellcmd( clean_string( rawurldecode($_GET["m"]) ) ) : NULL;
@@ -22,7 +22,8 @@
 $hostcols = isset($_GET["hc"]) ?
        clean_number( $_GET["hc"] ) : NULL;
 # Flag, whether or not to show a list of hosts
-$showhosts = isset($_GET["sh"]) ? 1 : NULL;
+$showhosts = isset($_GET["sh"]) ?
+       clean_number( $_GET["sh"] ) : NULL;
 # The 'p' variable specifies the verbosity level in the physical view.
 $physical = isset($_GET["p"]) ?
        clean_number( $_GET["p"] ) : NULL;
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Ganglia-developers mailing list
Ganglia-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-developers

Reply via email to