Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Autolink copyright and make autolink more robust when passed in empty…

… non strings
  • Loading branch information...
commit 5fa47d998d524640af420e98197f624538b5d2c6 1 parent da1f3a7
@jwheare authored
Showing with 3 additions and 1 deletion.
  1. +2 −1  src/js/controllers/playlist.controller.js
  2. +1 −0  src/js/util.js
View
3  src/js/controllers/playlist.controller.js
@@ -291,7 +291,8 @@ Playlist.prototype = {
this.actionsElem.hide();
},
loadCopyright: function () {
- this.copyrightElem.text(this.current.copyright || '');
+ var escapedCopyright = $('<div>').html(this.current.copyright).text();
+ this.copyrightElem.html(UTIL.autoLink(escapedCopyright) || '');
},
loadSource: function () {
if (this.current.source) {
View
1  src/js/util.js
@@ -42,6 +42,7 @@ var UTIL = {
// Based on http://daringfireball.net/2009/11/liberal_regex_for_matching_urls
autolink_regexp: /\b([\w-]+:\/+|www[.])[^\s()<>]+(?:\([\w\d]+\)|(?:[^.,;'">\:\s\<\>\)\]\!]|\/))/g,
autoLink: function (word) {
+ word = word || '';
return word.replace(UTIL.autolink_regexp, function (match, protocol, index, full) {
var url = match;
if (protocol == 'www.') {
Please sign in to comment.
Something went wrong with that request. Please try again.