Fix indenting and formatting
This commit is contained in:
@@ -735,8 +735,9 @@ function display_page_range($currentPage=1, $pageRange=1, $totalPages=1, $linkur
|
||||
echo "<a href='".$linkurl."&page=$nextPage'>></a> ";
|
||||
echo "<a href='".$linkurl."&page=$totalPages'>>|</a> ";
|
||||
} else
|
||||
{
|
||||
echo "> >|";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Expand a path like /something/somedirectory/../ to /something
|
||||
@@ -744,13 +745,16 @@ function display_page_range($currentPage=1, $pageRange=1, $totalPages=1, $linkur
|
||||
function SimplifyPath($path) {
|
||||
$dirs = explode('/',$path);
|
||||
|
||||
for($i=0; $i<count($dirs);$i++) {
|
||||
if($dirs[$i]=="." || $dirs[$i]=="") {
|
||||
for($i=0; $i<count($dirs);$i++)
|
||||
{
|
||||
if($dirs[$i]=="." || $dirs[$i]=="")
|
||||
{
|
||||
array_splice($dirs,$i,1);
|
||||
$i--;
|
||||
}
|
||||
|
||||
if($dirs[$i]=="..") {
|
||||
if($dirs[$i]=="..")
|
||||
{
|
||||
$cnt = count($dirs);
|
||||
$dirs=Simplify($dirs, $i);
|
||||
$i-= $cnt-count($dirs);
|
||||
@@ -759,7 +763,8 @@ function SimplifyPath($path) {
|
||||
return implode('/',$dirs);
|
||||
}
|
||||
|
||||
function Simplify($dirs, $idx) {
|
||||
function Simplify($dirs, $idx)
|
||||
{
|
||||
if($idx==0) return $dirs;
|
||||
|
||||
if($dirs[$idx-1]=="..") Simplify($dirs, $idx-1);
|
||||
|
||||
Reference in New Issue
Block a user