mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 06:25:50 +01:00
Merge branch 'master' of https://github.com/designcreateplay/NodeBB
This commit is contained in:
@@ -173,7 +173,7 @@ var RDB = require('./redis.js'),
|
|||||||
var href = this.attr('href');
|
var href = this.attr('href');
|
||||||
|
|
||||||
if (href && !href.match(domain)) {
|
if (href && !href.match(domain)) {
|
||||||
this.attr('href', domain + 'outgoing?' + href);
|
this.attr('href', domain + 'outgoing?url=' + encodeURIComponent(href));
|
||||||
if (!isSignature) this.append(' <i class="icon-external-link"></i>');
|
if (!isSignature) this.append(' <i class="icon-external-link"></i>');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -139,10 +139,11 @@ var user = require('./../user.js'),
|
|||||||
});
|
});
|
||||||
|
|
||||||
app.get('/api/outgoing', function(req, res) {
|
app.get('/api/outgoing', function(req, res) {
|
||||||
var url = req.url.split('?');
|
var url = req.query.url;
|
||||||
if (url[1]) {
|
|
||||||
|
if (url) {
|
||||||
res.json({
|
res.json({
|
||||||
url: url[1],
|
url: url,
|
||||||
home: global.nconf.get('url')
|
home: global.nconf.get('url')
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -368,19 +368,15 @@ var express = require('express'),
|
|||||||
});
|
});
|
||||||
|
|
||||||
app.get('/outgoing', function(req, res) {
|
app.get('/outgoing', function(req, res) {
|
||||||
var url = req.url.split('?');
|
if (!req.query.url) return res.redirect('/404');
|
||||||
|
|
||||||
if (url[1]) {
|
|
||||||
app.build_header({ req: req, res: res }, function(err, header) {
|
app.build_header({ req: req, res: res }, function(err, header) {
|
||||||
res.send(header + templates['outgoing'].parse({
|
res.send(
|
||||||
url: url[1],
|
header +
|
||||||
home: global.nconf.get('url')
|
'\n\t<script>templates.ready(function(){ajaxify.go("outgoing?url=' + req.query.url + '");});</script>' +
|
||||||
}) + templates['footer']);
|
templates['footer']
|
||||||
|
);
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
res.status(404);
|
|
||||||
res.redirect(global.nconf.get('relative_path') + '/404');
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
app.get('/search', function(req, res) {
|
app.get('/search', function(req, res) {
|
||||||
|
|||||||
Reference in New Issue
Block a user