Subversion Repositories cheapmusic

Rev

Rev 103 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 103 Rev 155
Line 242... Line 242...
242
         // reset code
242
         // reset code
243
         $this->sCode = '';
243
         $this->sCode = '';
244
         
244
         
245
         // loop through and generate the code letter by letter
245
         // loop through and generate the code letter by letter
246
         for ($i = 0; $i < $this->iNumChars; $i++) {
246
         for ($i = 0; $i < $this->iNumChars; $i++) {
247
            if (count($this->aCharSet) > 0) {
247
            if (is_countable($this->aCharSet) && count($this->aCharSet) > 0) {
248
               // select random character and add to code string
248
               // select random character and add to code string
249
               $this->sCode .= $this->aCharSet[array_rand($this->aCharSet)];
249
               $this->sCode .= $this->aCharSet[array_rand($this->aCharSet)];
250
            } else {
250
            } else {
251
               // select random character and add to code string
251
               // select random character and add to code string
252
               $this->sCode .= chr(rand(65, 90));
252
               $this->sCode .= chr(rand(65, 90));