Limit /words to 50.
This commit is contained in:
		| @@ -155,6 +155,10 @@ function rand_words($onewordmode) { | |||||||
|   $num++; |   $num++; | ||||||
|   $words = array(); |   $words = array(); | ||||||
|   if (is_integer($num)) { |   if (is_integer($num)) { | ||||||
|  | 	if ($num > 50) { | ||||||
|  | 	  send_text("Too many words.", true); | ||||||
|  | 	  return; | ||||||
|  | 	} | ||||||
|     $wordlist = file("/usr/share/dict/words"); |     $wordlist = file("/usr/share/dict/words"); | ||||||
|     for ($word=1; $word < $num; $word++) { |     for ($word=1; $word < $num; $word++) { | ||||||
|       $words[] = $wordlist[rand(0,count($wordlist))]; |       $words[] = $wordlist[rand(0,count($wordlist))]; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user