Skip to content

Commit

Permalink
Dependencies: Upgrading packages
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanlelek committed Aug 11, 2019
1 parent 126cfe3 commit 541fc2f
Show file tree
Hide file tree
Showing 9 changed files with 1,931 additions and 1,122 deletions.
11 changes: 6 additions & 5 deletions app/functions/contentProcessors.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

const path = require('path');
const fs = require('fs-extra');
const _ = require('underscore');
const _s = require('underscore.string');
const yaml = require('js-yaml');

Expand Down Expand Up @@ -30,9 +31,9 @@ function cleanString (str, use_underscore) {

// Clean object strings.
function cleanObjectStrings (obj) {
let cleanObj = {};
for (let field in obj) {
if (obj.hasOwnProperty(field)) {
const cleanObj = {};
for (const field in obj) {
if (_.has(obj, field)) {
cleanObj[cleanString(field, true)] = ('' + obj[field]).trim();
}
}
Expand Down Expand Up @@ -103,10 +104,10 @@ function processVars (markdownContent, config) {
markdownContent = markdownContent.replace(new RegExp('%' + v.name + '%', 'g'), v.content);
});
}
if (config.base_url) {
if (config.base_url !== undefined) {
markdownContent = markdownContent.replace(/%base_url%/g, config.base_url);
}
if (config.image_url) {
if (config.image_url !== undefined) {
markdownContent = markdownContent.replace(/%image_url%/g, config.image_url);
}
return markdownContent;
Expand Down
4 changes: 2 additions & 2 deletions app/routes/login.route.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ function route_login (config) {

for (var i = 0; i < config.credentials.length; i++) {
if (
req.param('username') === config.credentials[i].username &&
req.param('password') === config.credentials[i].password
req.body.username === config.credentials[i].username &&
req.body.password === config.credentials[i].password
) {
req.session.loggedIn = true;
req.session.username = config.credentials[i].username;
Expand Down
2 changes: 1 addition & 1 deletion app/routes/search.route.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function route_search (config) {
var sanitizedQuery = validator.blacklist(tagFreeQuery, invalidChars);

// trim and convert to string
var searchQuery = validator.toString(sanitizedQuery).trim();
var searchQuery = sanitizedQuery.toString(sanitizedQuery).trim();

var searchResults = await searchHandler(searchQuery, config);
var pageListSearch = remove_image_content_directory(config, await contentsHandler(null, config));
Expand Down
1 change: 1 addition & 0 deletions app/routes/wildcard.route.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ function route_wildcard (config) {
pages : build_nested_pages(pageList),
meta : meta,
content : content,
current_url : req.protocol + '://' + req.get('host') + req.originalUrl,
body_class : template + '-' + contentProcessors.cleanString(slug),
last_modified : await utils.getLastModified(config, meta, file_path),
lang : config.lang,
Expand Down
Loading

0 comments on commit 541fc2f

Please sign in to comment.