projects
/
acontent.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7fc09ab
)
http://atutor.ca/atutor/mantis/view.php?id=4276
author
Harris Wong
<hwong@ocad.ca>
Fri, 24 Sep 2010 15:12:46 +0000
(15:12 -0000)
committer
Harris Wong
<hwong@ocad.ca>
Fri, 24 Sep 2010 15:12:46 +0000
(15:12 -0000)
docs/home/ims/ims_import.php
patch
|
blob
|
history
diff --git
a/docs/home/ims/ims_import.php
b/docs/home/ims/ims_import.php
index
0e7e3fa
..
1d2e444
100644
(file)
--- a/
docs/home/ims/ims_import.php
+++ b/
docs/home/ims/ims_import.php
@@
-414,6
+414,12
@@
function removeCommonPath($items){
//actually use '\' and return the whole string.
$common_array = explode('/', $common_path);
$path_array = explode('/', $path);
//actually use '\' and return the whole string.
$common_array = explode('/', $common_path);
$path_array = explode('/', $path);
+ //convert path_array to absolute path
+ //TODO: array_search is slow, build a faster search
+ $pos=array_search('..', $path_array);
+ while($pos=array_search('..', $path_array)){
+ array_splice($path_array, $pos-1, 2);
+ }
$intersect_array = array_intersect($common_array, $path_array);
$common_path = implode('/', $intersect_array);
}
$intersect_array = array_intersect($common_array, $path_array);
$common_path = implode('/', $intersect_array);
}