climate-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject svn commit: r1563520 - /incubator/climate/trunk/ocw-ui/backend/directory_helpers.py
Date Sat, 01 Feb 2014 23:57:16 GMT
Author: joyce
Date: Sat Feb  1 23:57:16 2014
New Revision: 1563520

URL: http://svn.apache.org/r1563520
Log:
CLIMATE-326 - Simply directory clean regex in directory_helpers

Modified:
    incubator/climate/trunk/ocw-ui/backend/directory_helpers.py

Modified: incubator/climate/trunk/ocw-ui/backend/directory_helpers.py
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/ocw-ui/backend/directory_helpers.py?rev=1563520&r1=1563519&r2=1563520&view=diff
==============================================================================
--- incubator/climate/trunk/ocw-ui/backend/directory_helpers.py (original)
+++ incubator/climate/trunk/ocw-ui/backend/directory_helpers.py Sat Feb  1 23:57:16 2014
@@ -116,7 +116,7 @@ def getPathLeader():
 def _get_clean_directory_path(path_leader, dir_path):
     ''''''
     # Strip out any .. or . relative directories and remove duplicate slashes
-    dir_path = re.sub('/\.\./|/\.\.|/\./|/\.', '/', dir_path)
+    dir_path = re.sub('/[\./]*/?', '/', dir_path)
     dir_path = re.sub('//+', '/', dir_path)
 
     # Prevents the directory path from being a substring of the path leader.



Mime
View raw message