BUGFIX: match returns null on not-found, querying raw.length resulted in an error. Now it's possible to add links to the page again.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@94378 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Mateusz Uzdowski 2009-12-03 22:23:57 +00:00 committed by Sam Minnee
parent a783448266
commit f2fd76f770

View File

@ -60,7 +60,7 @@ LinkForm.prototype = {
getAnchors: function() { getAnchors: function() {
var raw = tinyMCE.activeEditor.getContent().match(/name="([a-zA-Z0-9-_]+?)"/gim); var raw = tinyMCE.activeEditor.getContent().match(/name="([a-zA-Z0-9-_]+?)"/gim);
if (raw.length) { if (raw && raw.length) {
var anchors = new Array(); var anchors = new Array();
for(var i = 0; i < raw.length; i++) { for(var i = 0; i < raw.length; i++) {
anchors.push(raw[i].substr(6).replace(/"$/, '')); anchors.push(raw[i].substr(6).replace(/"$/, ''));