original_string: public function getScheme($scheme, $config, $context)
      {
          if (!$config) {
              $config = HTMLPurifier_Config::createDefault();
          }
  
          // important, otherwise attacker could include arbitrary file
          $allowed_schemes = $config->get('URI.AllowedSchemes');
          if (!$config->get('URI.OverrideAllowedSchemes') &&
              !isset($allowed_schemes[$scheme])
          ) {
              return;
          }
  
          if (isset($this->schemes[$scheme])) {
              return $this->schemes[$scheme];
          }
          if (!isset($allowed_schemes[$scheme])) {
              return;
          }
  
          $class = 'HTMLPurifier_URIScheme_' . $scheme;
          if (!class_exists($class)) {
              return;
          }
          $this->schemes[$scheme] = new $class();
          return $this->schemes[$scheme];
      }
code: public function getScheme($scheme, $config, $context)
      {
          if (!$config) {
              $config = HTMLPurifier_Config::createDefault();
          }
  
          // important, otherwise attacker could include arbitrary file
          $allowed_schemes = $config->get('URI.AllowedSchemes');
          if (!$config->get('URI.OverrideAllowedSchemes') &&
              !isset($allowed_schemes[$scheme])
          ) {
              return;
          }
  
          if (isset($this->schemes[$scheme])) {
              return $this->schemes[$scheme];
          }
          if (!isset($allowed_schemes[$scheme])) {
              return;
          }
  
          $class = 'HTMLPurifier_URIScheme_' . $scheme;
          if (!class_exists($class)) {
              return;
          }
          $this->schemes[$scheme] = new $class();
          return $this->schemes[$scheme];
      }
code_tokens: public function getScheme ( $ scheme , $ config , $ context ) { if ( ! $ config ) { $ config = HTMLPurifier_Config :: createDefault ( ) ; } // important, otherwise attacker could include arbitrary file $ allowed_schemes = $ config -> get ( 'URI.AllowedSchemes' ) ; if ( ! $ config -> get ( 'URI.OverrideAllowedSchemes' ) && ! isset ( $ allowed_schemes [ $ scheme ] ) ) { return ; } if ( isset ( $ this -> schemes [ $ scheme ] ) ) { return $ this -> schemes [ $ scheme ] ; } if ( ! isset ( $ allowed_schemes [ $ scheme ] ) ) { return ; } $ class = 'HTMLPurifier_URIScheme_' . $ scheme ; if ( ! class_exists ( $ class ) ) { return ; } $ this -> schemes [ $ scheme ] = new $ class ( ) ; return $ this -> schemes [ $ scheme ] ; }
docstring: Retrieves a scheme validator object
  @param string $scheme String scheme name like http or mailto
  @param HTMLPurifier_Config $config
  @param HTMLPurifier_Context $context
  @return HTMLPurifier_URIScheme
docstring_tokens: Retrieves a scheme validator object