Show More
@@ -114,7 +114,8 b' class Node(object):' | |||||
114 | only. Moreover, every single node is identified by the ``path`` attribute, |
|
114 | only. Moreover, every single node is identified by the ``path`` attribute, | |
115 | so it cannot end with slash, too. Otherwise, path could lead to mistakes. |
|
115 | so it cannot end with slash, too. Otherwise, path could lead to mistakes. | |
116 | """ |
|
116 | """ | |
117 |
|
117 | RTLO_MARKER = u"\u202E" # RTLO marker allows swapping text, and certain | ||
|
118 | # security attacks could be used with this | |||
118 | commit = None |
|
119 | commit = None | |
119 |
|
120 | |||
120 | def __init__(self, path, kind): |
|
121 | def __init__(self, path, kind): | |
@@ -149,6 +150,20 b' class Node(object):' | |||||
149 | return safe_unicode(self.path) |
|
150 | return safe_unicode(self.path) | |
150 |
|
151 | |||
151 | @LazyProperty |
|
152 | @LazyProperty | |
|
153 | def has_rtlo(self): | |||
|
154 | """Detects if a path has right-to-left-override marker""" | |||
|
155 | return self.RTLO_MARKER in self.unicode_path | |||
|
156 | ||||
|
157 | @LazyProperty | |||
|
158 | def unicode_path_safe(self): | |||
|
159 | """ | |||
|
160 | Special SAFE representation of path without the right-to-left-override. | |||
|
161 | This should be only used for "showing" the file, cannot be used for any | |||
|
162 | urls etc. | |||
|
163 | """ | |||
|
164 | return safe_unicode(self.path).replace(self.RTLO_MARKER, '') | |||
|
165 | ||||
|
166 | @LazyProperty | |||
152 | def dir_path(self): |
|
167 | def dir_path(self): | |
153 | """ |
|
168 | """ | |
154 | Returns name of the directory from full path of this vcs node. Empty |
|
169 | Returns name of the directory from full path of this vcs node. Empty |
General Comments 0
You need to be logged in to leave comments.
Login now