Ignore:
Timestamp:
Feb 5, 2009, 4:04:27 AM (15 years ago)
Author:
rvelices
Message:

merge r 3126 from trunk

  • embellish_url compacts now ..
  • some trigger improvements (render_category_description)
  • improved perf of duplicate_xxx_url ( rewrote func params_for_duplication and remove some vars from $page )
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0/include/functions_url.inc.php

    r3046 r3127  
    3939    $root_url = PHPWG_ROOT_PATH;
    4040  }
    41   if ( dirname($root_url)!='.' )
     41  if ( strncmp($root_url, './', 2) != 0 )
    4242  {
    4343    return $root_url;
     
    171171  global $page;
    172172
    173   if (count($removed) > 0)
    174   {
    175     $params = array();
    176 
    177     foreach ($page as $page_item_key => $page_item_value)
    178     {
    179       if (!in_array($page_item_key, $removed))
    180       {
    181         $params[$page_item_key] = $page_item_value;
    182       }
    183     }
    184   }
    185   else
    186   {
    187     $params = $page;
     173  $params = $page;
     174
     175  foreach ($removed as $param_key)
     176  {
     177    unset($params[$param_key]);
    188178  }
    189179
     
    723713function embellish_url($url)
    724714{
    725   return str_replace('/./', '/', $url);
     715  $url = str_replace('/./', '/', $url);
     716  while ( ($dotdot = strpos($url, '/../', 1) ) !== false )
     717  {
     718    $before = strrpos($url, '/', -(strlen($url)-$dotdot+1) );
     719    if ($before !== false)
     720    {
     721      $url = substr_replace($url, '', $before, $dotdot-$before+3);
     722    }
     723    else
     724      break;
     725  }
     726  return $url;
    726727}
    727728
Note: See TracChangeset for help on using the changeset viewer.