Skip to content

Commit

Permalink
Use test() instead of search()
Browse files Browse the repository at this point in the history
  • Loading branch information
adam3smith committed Apr 24, 2023
1 parent 3a9da4a commit 1b5e6d8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Embedded Metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsibv",
"lastUpdated": "2023-04-24 14:18:06"
"lastUpdated": "2023-04-24 14:42:56"
}

/*
Expand Down Expand Up @@ -736,7 +736,7 @@ function tryOgAuthors(doc) {
var authors = [];
var ogAuthors = ZU.xpath(doc, '//meta[@property="article:author" or @property="video:director" or @property="music:musician"]');
for (var i = 0; i < ogAuthors.length; i++) {
if (ogAuthors[i].content && ogAuthors[i].content.search(/(https?:\/\/)?[\da-z.-]+\.[a-z.]{2,6}/) < 0 && ogAuthors[i].content !== "false") {
if (ogAuthors[i].content && /(https?:\/\/)?[\da-z.-]+\.[a-z.]{2,6}/.test(ogAuthors[i].content) && ogAuthors[i].content !== "false") {
authors.push(ZU.cleanAuthor(ogAuthors[i].content, "author"));
}
}
Expand Down

0 comments on commit 1b5e6d8

Please sign in to comment.