Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Thursday, October 15, 2026

Diff for phpPlatonLib/Platon/Platon.php between version 1.8 and 1.9

version 1.8, 2003/01/13 12:49:05 version 1.9, 2003/01/13 12:56:26
Line 485  class Platon
Line 485  class Platon
         return str_replace(' ', ' ', htmlspecialchars($str));          return str_replace(' ', ' ', htmlspecialchars($str));
     } /* }}} */      } /* }}} */
   
     /** common/str/fnc.escape_email.php - escape e-mail address      /**
        * Escapes e-mail address.
        *
        * @param   string  $email  e-mail address
        * @param   string  $mode   url            - does URL escaping
        *                          html           - does HTML escaping
        *                          hypertext_link - creates hypertext link
        * @param   string  $attr   when creating hypertext link, additional
        *                          attributes may be added
        * @return  string  escaped e-mail added
      */       */
     function escape_email($email, $mode = 'create_hypertext', $attributes = '') /* {{{ */      function escape_email($email, $mode = 'hypertext_link', $attr = '')/* {{{ */
     {      {
         /* Code borrowed from Smarty template engine;          /* Code borrowed from Smarty template engine;
            Smarty-2.1.0/plugins/modifier.escape.php file */             Smarty-2.1.0/plugins/modifier.escape.php file */
Line 502  class Platon
Line 511  class Platon
                 break;                  break;
             case 'html':              case 'html':
                 for ($x = 0; $x < strlen($email); $x++) {                  for ($x = 0; $x < strlen($email); $x++) {
                     $ret .= (ord($email[$x]) > 127 ? $email[$x] : '&#x'.bin2hex($email[$x]).';');                      $ret .= (ord($email[$x]) > 127
                               ? $email[$x] : '&#x'.bin2hex($email[$x]).';');
                 }                  }
                 break;                  break;
             default:              default:
             case 'create_hypertext':              case 'hypertext_link':
                 is_array($attributes) && $attributes = join(' ', $attributes);                  is_array($attr) && $attr = join(' ', $attr);
                 $attributes != '' && $attributes .= ' ';                  $attr != '' && $attr .= ' ';
                 $ret = '<a '.$attributes.'href="mailto:'                  $ret = '<a '.$attr.'href="mailto:'
                     . escape_email($email, 'url') . '">'                      . Platon::escape_email($email, 'url') . '">'
                     . escape_email($email, 'html') . '</a>';                      . Platon::escape_email($email, 'html') . '</a>';
                 break;                  break;
         }          }
         return $ret;          return $ret;
Line 523  class Platon
Line 533  class Platon
      *       *
      * @param   mixed   $url    string URL or array from Platon::glue_url()       * @param   mixed   $url    string URL or array from Platon::glue_url()
      * @return  string          path without scriptname       * @return  string          path without scriptname
      * @access  public  
      */       */
     function get_path_without_scriptname($url) /* {{{ */      function get_path_without_scriptname($url) /* {{{ */
     {      {
Line 542  class Platon
Line 551  class Platon
      * @return  string          glued url       * @return  string          glued url
      * @author  Tomas V.V.Cox <cox@idecnet.com>       * @author  Tomas V.V.Cox <cox@idecnet.com>
      * @date    19/Feb/2001       * @date    19/Feb/2001
      * @access  public  
      */       */
     function glue_url($url) /* {{{ */      function glue_url($url) /* {{{ */
     {      {

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top