After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 755436 - gitg doesn't escape the commit message
gitg doesn't escape the commit message
Status: RESOLVED FIXED
Product: gitg
Classification: Applications
Component: gitg
git master
Other FreeBSD
: Normal normal
: ---
Assigned To: gitg-maint
gitg-maint
Depends on:
Blocks:
 
 
Reported: 2015-09-22 19:00 UTC by Ting-Wei Lan
Modified: 2015-09-23 06:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Properly escape commit messages in diff view (969 bytes, patch)
2015-09-22 19:05 UTC, Ting-Wei Lan
committed Details | Review

Description Ting-Wei Lan 2015-09-22 19:00:18 UTC
In libgitg/resources/ui/diff-view/diff-view.js, function prettify_message:

var escaped = html_escape(ret);

escaped = ret.replace(/(https?:[^\s]*[^.])/g, "<a href=\"$1\" onclick=\"javascript:return open_url(this);\">$1</a>");

return escaped;


The result of html_escape is not used because it uses ret.replace instead of escaped.replace.
Comment 1 Ting-Wei Lan 2015-09-22 19:05:30 UTC
Created attachment 311904 [details] [review]
Properly escape commit messages in diff view
Comment 2 Ignacio Casal Quinteiro (nacho) 2015-09-22 19:36:36 UTC
Review of attachment 311904 [details] [review]:

Looks good. Please push it to gnome-3-18 only.
Comment 3 Ting-Wei Lan 2015-09-23 00:06:28 UTC
Attachment 311904 [details] pushed as 8152820 - Properly escape commit messages in diff view
Comment 4 Ting-Wei Lan 2015-09-23 00:15:17 UTC
(In reply to Ignacio Casal Quinteiro (nacho) from comment #2)
> Review of attachment 311904 [details] [review] [review]:
> 
> Looks good. Please push it to gnome-3-18 only.

Do you mean that related code in master branch will be modified soon, so we should not push this change to it now?
Comment 5 Ignacio Casal Quinteiro (nacho) 2015-09-23 06:58:58 UTC
Yup, just pushed to master the other branch. Cheers.