}
public function execute( $par ) {
- global $wgScript;
-
$cat = false;
$categoryStr = $this->getRequest()->getText( 'category', $par );
$submit = Html::input( '', $submitText, 'submit' );
$msg = $this->msg( 'randomincategory-selectcategory' );
- $form = Html::rawElement( 'form', array( 'action' => $wgScript ),
+ $form = Html::rawElement( 'form', array( 'action' => wfScript() ),
Html::hidden( 'title', $this->getPageTitle()->getPrefixedText() ) .
$msg->rawParams( $input, $submit )->parse()
);
/**
* Choose a random title.
- * @return Title object (or null if nothing to choose from)
+ * @return Title|null Title object (or null if nothing to choose from)
*/
public function getRandomTitle() {
// Convert to float, since we do math with the random number.
* was a large gap in the distribution of cl_timestamp values. This way instead
* of things to the right of the gap being favoured, both sides of the gap
* are favoured.
- * @return Array Query information.
+ * @return array Query information.
*/
protected function getQueryInfo( $rand, $offset, $up ) {
$op = $up ? '>=' : '<=';
* Get the lowest and highest timestamp for a category.
*
* @param Title $category
- * @return Array The lowest and highest timestamp
- * @throws MWException if category has no entries.
+ * @return array The lowest and highest timestamp
+ * @throws MWException If category has no entries.
*/
protected function getMinAndMaxForCat( Title $category ) {
$dbr = wfGetDB( DB_SLAVE );
* @param float $rand A random number that is converted to a random timestamp
* @param int $offset A small offset to make the result seem more "random"
* @param bool $up Get the result above the random value
- * @param String $fname The name of the calling method
- * @return Array Info for the title selected.
+ * @param string $fname The name of the calling method
+ * @return array Info for the title selected.
*/
private function selectRandomPageFromDB( $rand, $offset, $up, $fname = __METHOD__ ) {
$dbr = wfGetDB( DB_SLAVE );