Show More
@@ -128,6 +128,11 b' def _hash_key(k):' | |||
|
128 | 128 | return sha1_safe(k) |
|
129 | 129 | |
|
130 | 130 | |
|
131 | def description_escaper(desc): | |
|
132 | from rhodecode.lib import helpers as h | |
|
133 | return h.html_escape(desc) | |
|
134 | ||
|
135 | ||
|
131 | 136 | def in_filter_generator(qry, items, limit=500): |
|
132 | 137 | """ |
|
133 | 138 | Splits IN() into multiple with OR |
@@ -663,16 +668,14 b' class User(Base, BaseModel):' | |||
|
663 | 668 | |
|
664 | 669 | @hybrid_property |
|
665 | 670 | def first_name(self): |
|
666 | from rhodecode.lib import helpers as h | |
|
667 | 671 | if self.name: |
|
668 |
return |
|
|
672 | return description_escaper(self.name) | |
|
669 | 673 | return self.name |
|
670 | 674 | |
|
671 | 675 | @hybrid_property |
|
672 | 676 | def last_name(self): |
|
673 | from rhodecode.lib import helpers as h | |
|
674 | 677 | if self.lastname: |
|
675 |
return |
|
|
678 | return description_escaper(self.lastname) | |
|
676 | 679 | return self.lastname |
|
677 | 680 | |
|
678 | 681 | @hybrid_property |
@@ -1368,8 +1371,7 b' class UserApiKeys(Base, BaseModel):' | |||
|
1368 | 1371 | |
|
1369 | 1372 | @hybrid_property |
|
1370 | 1373 | def description_safe(self): |
|
1371 | from rhodecode.lib import helpers as h | |
|
1372 | return h.escape(self.description) | |
|
1374 | return description_escaper(self.description) | |
|
1373 | 1375 | |
|
1374 | 1376 | @property |
|
1375 | 1377 | def expired(self): |
@@ -1472,8 +1474,7 b' class UserIpMap(Base, BaseModel):' | |||
|
1472 | 1474 | |
|
1473 | 1475 | @hybrid_property |
|
1474 | 1476 | def description_safe(self): |
|
1475 | from rhodecode.lib import helpers as h | |
|
1476 | return h.escape(self.description) | |
|
1477 | return description_escaper(self.description) | |
|
1477 | 1478 | |
|
1478 | 1479 | @classmethod |
|
1479 | 1480 | def _get_ip_range(cls, ip_addr): |
@@ -1611,8 +1612,7 b' class UserGroup(Base, BaseModel):' | |||
|
1611 | 1612 | |
|
1612 | 1613 | @hybrid_property |
|
1613 | 1614 | def description_safe(self): |
|
1614 | from rhodecode.lib import helpers as h | |
|
1615 | return h.escape(self.user_group_description) | |
|
1615 | return description_escaper(self.user_group_description) | |
|
1616 | 1616 | |
|
1617 | 1617 | @hybrid_property |
|
1618 | 1618 | def group_data(self): |
@@ -1956,8 +1956,7 b' class Repository(Base, BaseModel):' | |||
|
1956 | 1956 | |
|
1957 | 1957 | @hybrid_property |
|
1958 | 1958 | def description_safe(self): |
|
1959 | from rhodecode.lib import helpers as h | |
|
1960 | return h.escape(self.description) | |
|
1959 | return description_escaper(self.description) | |
|
1961 | 1960 | |
|
1962 | 1961 | @hybrid_property |
|
1963 | 1962 | def landing_rev(self): |
@@ -2915,8 +2914,7 b' class RepoGroup(Base, BaseModel):' | |||
|
2915 | 2914 | |
|
2916 | 2915 | @hybrid_property |
|
2917 | 2916 | def description_safe(self): |
|
2918 | from rhodecode.lib import helpers as h | |
|
2919 | return h.escape(self.group_description) | |
|
2917 | return description_escaper(self.group_description) | |
|
2920 | 2918 | |
|
2921 | 2919 | @classmethod |
|
2922 | 2920 | def hash_repo_group_name(cls, repo_group_name): |
@@ -4418,8 +4416,7 b' class _PullRequestBase(BaseModel):' | |||
|
4418 | 4416 | |
|
4419 | 4417 | @hybrid_property |
|
4420 | 4418 | def description_safe(self): |
|
4421 | from rhodecode.lib import helpers as h | |
|
4422 | return h.escape(self.description) | |
|
4419 | return description_escaper(self.description) | |
|
4423 | 4420 | |
|
4424 | 4421 | @hybrid_property |
|
4425 | 4422 | def revisions(self): |
@@ -5027,8 +5024,7 b' class Gist(Base, BaseModel):' | |||
|
5027 | 5024 | |
|
5028 | 5025 | @hybrid_property |
|
5029 | 5026 | def description_safe(self): |
|
5030 | from rhodecode.lib import helpers as h | |
|
5031 | return h.escape(self.gist_description) | |
|
5027 | return description_escaper(self.gist_description) | |
|
5032 | 5028 | |
|
5033 | 5029 | @classmethod |
|
5034 | 5030 | def get_or_404(cls, id_): |
General Comments 0
You need to be logged in to leave comments.
Login now