Skip to content

Commit

Permalink
fix(utils): fix logic error in url validator
Browse files Browse the repository at this point in the history
  • Loading branch information
acburdine committed Sep 10, 2018
1 parent 03ecbde commit c8f3554
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/utils/url.js
Expand Up @@ -3,13 +3,13 @@
const {isURL} = require('validator');
const endsWithGhost = /\/ghost\/?$/i;

const validate = function validateURL(url, isAdmin) {
const validate = function validateURL(url) {
const isValidURL = isURL(url, {require_protocol: true});
if (!isValidURL) {
return 'Invalid domain. Your domain should include a protocol and a TLD, E.g. http://my-ghost-blog.com';
}

return (!isAdmin && !endsWithGhost.test(url)) || 'Ghost doesn\'t support running in a path that ends with `ghost`';
return (!endsWithGhost.test(url)) || 'Ghost doesn\'t support running in a path that ends with `ghost`';
};

const isCustomDomain = function isCustomDomain(input) {
Expand Down

0 comments on commit c8f3554

Please sign in to comment.