Remove \ character from password generation to avoid confusions
This commit is contained in:
		| @@ -63,6 +63,8 @@ function generate_random(size, only_ascii) | ||||
|     else | ||||
| 	symbols = new Array(1, 255); | ||||
|  | ||||
|     forbidden = new Array('\\'); | ||||
|  | ||||
|     var res = ""; | ||||
|     while (res.length < size) | ||||
|     { | ||||
| @@ -71,7 +73,18 @@ function generate_random(size, only_ascii) | ||||
| 	r = Math.round(Math.random()*diff); | ||||
| 	if (isNaN(r+symbols[a])) | ||||
| 	    continue; | ||||
| 	res += String.fromCharCode(r + symbols[a]);  | ||||
| 	character = String.fromCharCode(r + symbols[a]); | ||||
| 	forbid = false; | ||||
| 	for (var j=0; j<forbidden.length; j++) | ||||
| 	{ | ||||
| 	    if (character == forbidden[j]) | ||||
| 	    { | ||||
| 		forbid = true; | ||||
| 		break; | ||||
| 	    } | ||||
| 	} | ||||
| 	if (forbid) continue; | ||||
| 	res += character; | ||||
|     } | ||||
|  | ||||
|     return res; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user