salve, non trovo l'errore presente in questo apparentemente semplice codice:

Codice PHP:
function checkFileUpload(what) {

var 
i// indice 

var found 1// variabile di controllo 

trustExt = new Array("jpg""jpeg""bmp""png"); // elenco estensioni consentite

for (i in trustExt) { // comincio a cercare nell'array

if (found != 0) { // se non l'ho già trovato

found = (getExtension(what) != trustExt[i]) ? 0// se l'estensione è diversa resta 1, altrimenti diventa 0

}



found == alert("File non consentito") : found ==  1// reinizializzo per il prossimo controllo

}

function 
getExtension(mystring) {

return 
mystring.substring(mystring.lastIndexOf(".")+1mystring.length);
    

dove what è "this.value" di un <input type="file" />.

dove sbaglio?