Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.
   1  <?php
   2  
   3  // VERY RELAXED! Shouldn't cause problems, not even Firefox checks if the

   4  // email is valid, but be careful!

   5  
   6  /**

   7   * Validates mailto (for E-mail) according to RFC 2368

   8   * @todo Validate the email address

   9   * @todo Filter allowed query parameters

  10   */
  11  
  12  class HTMLPurifier_URIScheme_mailto extends HTMLPurifier_URIScheme
  13  {
  14      /**

  15       * @type bool

  16       */
  17      public $browsable = false;
  18  
  19      /**

  20       * @type bool

  21       */
  22      public $may_omit_host = true;
  23  
  24      /**

  25       * @param HTMLPurifier_URI $uri

  26       * @param HTMLPurifier_Config $config

  27       * @param HTMLPurifier_Context $context

  28       * @return bool

  29       */
  30      public function doValidate(&$uri, $config, $context)
  31      {
  32          $uri->userinfo = null;
  33          $uri->host     = null;
  34          $uri->port     = null;
  35          // we need to validate path against RFC 2368's addr-spec

  36          return true;
  37      }
  38  }
  39  
  40  // vim: et sw=4 sts=4