Skip to content

Commit

Permalink
3.4.7: bugfix-release / minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
zmsdev committed Mar 23, 2021
1 parent 3db6364 commit 1661430
Show file tree
Hide file tree
Showing 4 changed files with 7,514 additions and 7,313 deletions.
4 changes: 2 additions & 2 deletions Products/zms/ZMSTextformat.py
Expand Up @@ -30,8 +30,8 @@
def br_quote(text, subtag, REQUEST):
if len(subtag) == 0:
return text
if type(text) not in [str, str]:
text = str(text)
if standard.is_str(text):
text = standard.pybytes(text)
rtn = ''
qcr = ''
qtab = ' '*6
Expand Down
5 changes: 3 additions & 2 deletions Products/zms/_zreferableitem.py
Expand Up @@ -328,19 +328,20 @@ def refreshRefToObjs(self):
# ----------------------------------------------------------------------------
def validateInlineLinkObj(self, text):
if not int(self.getConfProperty('ZReferableItem.validateLinkObj', 1)): return text
text = standard.pybytes(text)
for pq in [('<a(.*?)>', 'href'), ('<img(.*?)>', 'src')]:
p = pq[0]
q = pq[1]
r = re.compile(p)
for f in r.findall(standard.pybytes(text)):
for f in r.findall(text):
d = dict(re.findall('\\s(.*?)="(.*?)"', f))
if 'data-id' in d:
old = p.replace('(.*?)', f)
url = d['data-id']
ild = getInternalLinkDict(self, url)
for k in ild:
d[{'data-url':q}.get(k, k)] = ild[k]
new = p.replace('(.*?)', ' '.join(['']+['%s="%s"'%(x,d[x]) for x in d]))
new = p.replace('(.*?)', ' '.join(['']+['%s="%s"'%(x,standard.pybytes(d[x])) for x in d]))
if old != new:
text = text.replace(old, new)
return text
Expand Down

0 comments on commit 1661430

Please sign in to comment.