mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 12:36:02 +01:00
fixed #256 - where saving and retrieval of RSS feeds wasn't working on some instances due to a relative path being passed to read/writeFile
This commit is contained in:
@@ -212,7 +212,7 @@ var express = require('express'),
|
|||||||
|
|
||||||
var tid = req.params.topic_id;
|
var tid = req.params.topic_id;
|
||||||
if (tid.match(/^\d+\.rss$/)) {
|
if (tid.match(/^\d+\.rss$/)) {
|
||||||
fs.readFile('feeds/topics/' + tid, function (err, data) {
|
fs.readFile(path.join(__dirname, '../', 'feeds/topics', tid), function (err, data) {
|
||||||
if (err) {
|
if (err) {
|
||||||
res.type('text').send(404, "Unable to locate an rss feed at this location.");
|
res.type('text').send(404, "Unable to locate an rss feed at this location.");
|
||||||
return;
|
return;
|
||||||
@@ -280,7 +280,7 @@ var express = require('express'),
|
|||||||
var cid = req.params.category_id;
|
var cid = req.params.category_id;
|
||||||
|
|
||||||
if (cid.match(/^\d+\.rss$/)) {
|
if (cid.match(/^\d+\.rss$/)) {
|
||||||
fs.readFile('feeds/categories/' + cid, function (err, data) {
|
fs.readFile(path.join(__dirname, '../', 'feeds/categories', cid), function (err, data) {
|
||||||
if (err) {
|
if (err) {
|
||||||
res.type('text').send(404, "Unable to locate an rss feed at this location.");
|
res.type('text').send(404, "Unable to locate an rss feed at this location.");
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user