Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Pondelok, 23. november 2026

Rozdiely pre phpWebFileManager/functions.inc.php medzi verziami 1.4 a 1.5

verzia 1.4, 2004/01/26 13:52:43 verzia 1.5, 2004/04/11 16:27:37
Riadok 17 
Riadok 17 
  * http://platon.sk/projects/phpWebFileManager/   * http://platon.sk/projects/phpWebFileManager/
  */   */
   
 /* $Platon: phpWebFileManager/functions.inc.php,v 1.3 2003/11/20 14:07:26 nepto Exp $ */  /* $Platon: phpWebFileManager/functions.inc.php,v 1.4 2004/01/26 13:52:43 nepto Exp $ */
   
 /* Functions in this file was extracted created from Platon class.  /* Functions in this file was extracted created from Platon class.
   
    Class Platon is part of Platon SDG PHP framework and can be accessible via     Class Platon is part of Platon SDG PHP framework and can be accessible via
    phpPlatonLib project. */     phpPlatonLib project. */
   
Riadok 70  function fm_get_cgi_var($name, $default_
Riadok 70  function fm_get_cgi_var($name, $default_
  */   */
 function fm_get_origvars_html($origvars, $method = 'POST', $default_value = '') /* {{{ */  function fm_get_origvars_html($origvars, $method = 'POST', $default_value = '') /* {{{ */
 {  {
         $ret    = '';      $ret    = '';
         $method = strtoupper($method);      $method = strtoupper($method);
         if ($method == 'POST') {      if ($method == 'POST') {
                 if (! is_array($origvars)) {          if (! is_array($origvars)) {
             $new_origvars = array();              $new_origvars = array();
                         foreach (explode('&', $origvars) as $param) {              foreach (explode('&', $origvars) as $param) {
                                 $parts = explode('=', $param, 2);                  $parts = explode('=', $param, 2);
                                 if (! isset($parts[1])) {                  if (! isset($parts[1])) {
                                         $parts[1] = $default_value;                      $parts[1] = $default_value;
                                 }                  }
                                 if (strlen($parts[0]) <= 0) {                  if (strlen($parts[0]) <= 0) {
                                         continue;                      continue;
                                 }                  }
                                 $new_origvars[$parts[0]] = $parts[1];                  $new_origvars[$parts[0]] = $parts[1];
                         }              }
             $origvars =& $new_origvars;              $origvars =& $new_origvars;
                 }          }
                 foreach ($origvars as $key => $val) {          foreach ($origvars as $key => $val) {
                         if (strlen($val) <= 0 && $default_value === null) {              if (strlen($val) <= 0 && $default_value === null) {
                                 continue;                  continue;
                         }              }
                         $key = rawurldecode($key);              $key = rawurldecode($key);
                         $val = rawurldecode($val);              $val = rawurldecode($val);
                         $ret .= '<input type="hidden" name="';              $ret .= '<input type="hidden" name="';
                         $ret .= htmlspecialchars($key).'"';              $ret .= htmlspecialchars($key).'"';
                         $ret .= ' value="'.htmlspecialchars($val).'"';              $ret .= ' value="'.htmlspecialchars($val).'"';
                         $ret .= " />\n";              $ret .= " />\n";
                 }          }
         } else if (! strncmp('GET', $method, 3)) {      } else if (! strncmp('GET', $method, 3)) {
                 if (! is_array($origvars)) {          if (! is_array($origvars)) {
                         $ret .= $origvars;              $ret .= $origvars;
                 } else {          } else {
                         foreach ($origvars as $key => $val) {              foreach ($origvars as $key => $val) {
                                 if (strlen($val) <= 0 && $default_value === null) {                  if (strlen($val) <= 0 && $default_value === null) {
                                         continue;                      continue;
                                 }                  }
                                 $ret == '' || $ret .= '&amp;';                  $ret == '' || $ret .= '&amp;';
                                 $ret .= htmlspecialchars(rawurlencode($key));                  $ret .= htmlspecialchars(rawurlencode($key));
                                 $ret .= '=';                  $ret .= '=';
                                 $ret .= htmlspecialchars(rawurlencode($val));                  $ret .= htmlspecialchars(rawurlencode($val));
                         }              }
                 }          }
                 if ($method[strlen($method) - 1] == '+') {          if ($method[strlen($method) - 1] == '+') {
                         $ret = "?$ret";              $ret = "?$ret";
                 }          }
         } else {      } else {
                 trigger_error('Unsupported Platon::get_origvars_html() method: '          trigger_error('Unsupported Platon::get_origvars_html() method: '
                                 .$method, E_USER_ERROR);                  .$method, E_USER_ERROR);
         }      }
         return $ret;      return $ret;
 } /* }}} */  } /* }}} */
   
 /**  /**
Riadok 132  function fm_get_origvars_html($origvars,
Riadok 132  function fm_get_origvars_html($origvars,
  */   */
 function fm_append_slash($string, $char = '/') /* {{{ */  function fm_append_slash($string, $char = '/') /* {{{ */
 {  {
         if (! is_string($string) || ! is_string($char)) {      if (! is_string($string) || ! is_string($char)) {
                 return false;          return false;
         }      }
         if (strlen($string) > 0) {      if (strlen($string) > 0) {
                 if ($string[strlen($string) - 1] != $char[0])          if ($string[strlen($string) - 1] != $char[0])
                         $string .= $char[0];              $string .= $char[0];
         }      }
         return $string;      return $string;
 } /* }}} */  } /* }}} */
   
 /**  /**
Riadok 151  function fm_append_slash($string, $char
Riadok 151  function fm_append_slash($string, $char
  */   */
 function fm_get_path_without_scriptname($url) /* {{{ */  function fm_get_path_without_scriptname($url) /* {{{ */
 {  {
         $path = is_array($url) ? $url['path'] : $url;      $path = is_array($url) ? $url['path'] : $url;
         $path = preg_replace('/http[s]?:\/\/[^\/]+/', '', $path);      $path = preg_replace('/http[s]?:\/\/[^\/]+/', '', $path);
         $path = preg_replace('/\?.*/', '', $path);      $path = preg_replace('/\?.*/', '', $path);
         $path = preg_replace('/[^\/]+\z/', '', $path);      $path = preg_replace('/[^\/]+\z/', '', $path);
         return $path;      return $path;
 } /* }}} */  } /* }}} */
   
 /**  /**
Riadok 169  function fm_get_path_without_scriptname(
Riadok 169  function fm_get_path_without_scriptname(
  */   */
 function fm_glue_url($url) /* {{{ */  function fm_glue_url($url) /* {{{ */
 {  {
         if (! is_array($url))      if (! is_array($url))
                 return false;          return false;
         // scheme      // scheme
         $uri = empty($url['scheme']) ? '' : $url['scheme'] . '://';      $uri = empty($url['scheme']) ? '' : $url['scheme'] . '://';
         // user and pass      // user and pass
         if (! empty($url['user'])) {      if (! empty($url['user'])) {
                 $uri .= $url['user'].':'.$url['pass'].'@';          $uri .= $url['user'].':'.$url['pass'].'@';
         }      }
         // host      // host
         $uri .= $url['host'];      $uri .= $url['host'];
         // port      // port
         $port = empty($url['port']) ? '' : ':'.$url['port'];      $port = empty($url['port']) ? '' : ':'.$url['port'];
         $uri .= $port;      $uri .= $port;
         // path      // path
         $uri .= $url['path'];      $uri .= $url['path'];
         // fragment or query      // fragment or query
         if (isset($url['fragment'])) {      if (isset($url['fragment'])) {
                 $uri .= '#' . $url['fragment'];          $uri .= '#' . $url['fragment'];
         }      }
         elseif (isset($url['query'])) {      elseif (isset($url['query'])) {
                 $uri .= '?' . $url['query'];          $uri .= '?' . $url['query'];
         }      }
         return $uri;      return $uri;
 } /* }}} */  } /* }}} */
   
 /* vim: set expandtab tabstop=4 shiftwidth=4:  /* vim: set expandtab tabstop=4 shiftwidth=4:

Legend:
Odstranené z verzie1.4  
zmenené riadky
  Pridané vo verzii1.5

Platon Group <platon@platon.sk> http://platon.sk/
Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok