diff --git a/api/src/activity/actor.js b/api/src/activity/actor.js
index a96bdae..0add255 100644
--- a/api/src/activity/actor.js
+++ b/api/src/activity/actor.js
@@ -16,8 +16,8 @@ module.exports = {
})
apex.net.actor.get.splice(apex.net.actor.get.length-1, 0,
async (req, res, next) => {
- res.locals.apex.target
- .manuallyApprovesFollowers = true
+ if (res.locals.apex.target !== undefined)
+ res.locals.apex.target.manuallyApprovesFollowers = true
next()
})
},
diff --git a/api/src/api-utils.js b/api/src/api-utils.js
index 241da8b..ce4dfd9 100644
--- a/api/src/api-utils.js
+++ b/api/src/api-utils.js
@@ -22,7 +22,8 @@ module.exports = {
html2text: (html) => {
html = decodeURIComponent(html)
html = html.replaceAll('>','>').replaceAll('<','<')
- .replaceAll('"','"').replaceAll('&','&')
+ .replaceAll('"','"').replaceAll(''', "'")
+ .replaceAll('&','&')
html = html.replaceAll(/
/g, '
')
html = html.replaceAll('
', '\n')
html = html.replaceAll('
', '\n')
diff --git a/web/src/app/js/pages/quiz.js b/web/src/app/js/pages/quiz.js
index 3c4b807..ae36962 100644
--- a/web/src/app/js/pages/quiz.js
+++ b/web/src/app/js/pages/quiz.js
@@ -24,6 +24,8 @@ app.pages.quiz = {
const onDataLoaded = async function(json) {
await app.template.loadMany(['quiz.index', 'quiz.item']);
+ if (json.from === undefined)
+ return hashredir();
page().data = json;
page().paint(json);
if (getNormalizedURI() === app.vars.app_dir &&
@@ -39,6 +41,8 @@ app.pages.quiz = {
},
paint: function(json) {
json = json || page().data;
+ if (json.from === undefined)
+ return hashredir();
if (json.from.props.age === undefined)
json.from.props.age = '??';
if (json.from.props.gender === undefined)
@@ -168,8 +172,6 @@ app.pages.quiz = {
});
},
send: async function() {
- if (!await app.toast.infoConfirm(s('app.confirm.crush_send_quiz')))
- return false;
const form = document.querySelector('form#quiz');
var data = { quiz_id: page().data.id };
for (var i = 0; i < page().data.content.length; i++) {
@@ -179,6 +181,8 @@ app.pages.quiz = {
return app.toast.error(s('app.error.must_fill_quiz'));
data[key] = value;
}
+ if (!await app.toast.infoConfirm(s('app.confirm.crush_send_quiz')))
+ return false;
http.post('/api/v1/me/quizs', data, function(json) {
if (json.error !== undefined)
app.toast.error(app.strings.app.error[json.error]);