Merge "Fix phpdoc of wfArrayToCgi"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 7 Dec 2015 20:39:59 +0000 (20:39 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 7 Dec 2015 20:40:00 +0000 (20:40 +0000)
1  2 
includes/GlobalFunctions.php

@@@ -374,22 -374,20 +374,22 @@@ function wfObjectToArray( $objOrArray, 
   * not likely to give duplicate values for any realistic
   * number of articles.
   *
 + * @note This is designed for use in relation to Special:RandomPage
 + *       and the page_random database field.
 + *
   * @return string
   */
  function wfRandom() {
 -      # The maximum random value is "only" 2^31-1, so get two random
 -      # values to reduce the chance of dupes
 +      // The maximum random value is "only" 2^31-1, so get two random
 +      // values to reduce the chance of dupes
        $max = mt_getrandmax() + 1;
        $rand = number_format( ( mt_rand() * $max + mt_rand() ) / $max / $max, 12, '.', '' );
 -
        return $rand;
  }
  
  /**
 - * Get a random string containing a number of pseudo-random hex
 - * characters.
 + * Get a random string containing a number of pseudo-random hex characters.
 + *
   * @note This is not secure, if you are trying to generate some sort
   *       of token please use MWCryptRand instead.
   *
@@@ -460,12 -458,12 +460,12 @@@ function wfUrlencode( $s ) 
  }
  
  /**
-  * This function takes two arrays as input, and returns a CGI-style string, e.g.
+  * This function takes one or two arrays as input, and returns a CGI-style string, e.g.
   * "days=7&limit=100". Options in the first array override options in the second.
   * Options set to null or false will not be output.
   *
   * @param array $array1 ( String|Array )
-  * @param array $array2 ( String|Array )
+  * @param array|null $array2 ( String|Array )
   * @param string $prefix
   * @return string
   */