original_string: protected function isExtensionAllowed($filename)
      {
          // retrieve the extension
          $pos = strrpos($filename, '.');
          $extension = '';
          if ($pos !== false) {
              $extension = strtolower(substr($filename, $pos + 1));
          }
  
          // if we have an extension, validate it agains the black and white lists
          if ($extension) {
              // not in whitelist?
              if (sizeof($this->allowedExtensions) > 0 && !in_array($extension, $this->allowedExtensions)) {
                  return false;
              }
  
              // in blacklist ?
              if (sizeof($this->deniedExtensions) && in_array($extension, $this->deniedExtensions)) {
                  return false;
              }
          } elseif (sizeof($this->allowedExtensions) > 0) {
              // no extension given, thus not in the whitelist!
              return false;
          }
  
          return true;
      }
code: protected function isExtensionAllowed($filename)
      {
          // retrieve the extension
          $pos = strrpos($filename, '.');
          $extension = '';
          if ($pos !== false) {
              $extension = strtolower(substr($filename, $pos + 1));
          }
  
          // if we have an extension, validate it agains the black and white lists
          if ($extension) {
              // not in whitelist?
              if (sizeof($this->allowedExtensions) > 0 && !in_array($extension, $this->allowedExtensions)) {
                  return false;
              }
  
              // in blacklist ?
              if (sizeof($this->deniedExtensions) && in_array($extension, $this->deniedExtensions)) {
                  return false;
              }
          } elseif (sizeof($this->allowedExtensions) > 0) {
              // no extension given, thus not in the whitelist!
              return false;
          }
  
          return true;
      }
code_tokens: protected function isExtensionAllowed ( $ filename ) { // retrieve the extension $ pos = strrpos ( $ filename , '.' ) ; $ extension = '' ; if ( $ pos !== false ) { $ extension = strtolower ( substr ( $ filename , $ pos + 1 ) ) ; } // if we have an extension, validate it agains the black and white lists if ( $ extension ) { // not in whitelist? if ( sizeof ( $ this -> allowedExtensions ) > 0 && ! in_array ( $ extension , $ this -> allowedExtensions ) ) { return false ; } // in blacklist ? if ( sizeof ( $ this -> deniedExtensions ) && in_array ( $ extension , $ this -> deniedExtensions ) ) { return false ; } } elseif ( sizeof ( $ this -> allowedExtensions ) > 0 ) { // no extension given, thus not in the whitelist! return false ; } return true ; }
docstring: Check if the extension  of the given filename is allowed.
  
  @param string $filename
  @return boolean
docstring_tokens: Check if the extension of the given filename is allowed .