main
Bob Mottram 2020-11-20 11:49:11 +00:00
parent 5364b71616
commit 6423c5950a
2 changed files with 13 additions and 9 deletions

View File

@ -2822,7 +2822,8 @@ class PubServer(BaseHTTPRequestHandler):
baseDir: str, httpPrefix: str, baseDir: str, httpPrefix: str,
domain: str, domainFull: str, domain: str, domainFull: str,
onionDomain: str, i2pDomain: str, debug: bool, onionDomain: str, i2pDomain: str, debug: bool,
defaultTimeline: str) -> None: defaultTimeline: str,
allowLocalNetworkAccess: bool) -> None:
"""Updates the left links column of the timeline """Updates the left links column of the timeline
""" """
usersPath = path.replace('/linksdata', '') usersPath = path.replace('/linksdata', '')
@ -2917,8 +2918,6 @@ class PubServer(BaseHTTPRequestHandler):
if nickname == adminNickname: if nickname == adminNickname:
if fields.get('editedAbout'): if fields.get('editedAbout'):
aboutStr = fields['editedAbout'] aboutStr = fields['editedAbout']
allowLocalNetworkAccess = \
self.server.allowLocalNetworkAccess
if not dangerousMarkup(aboutStr, if not dangerousMarkup(aboutStr,
allowLocalNetworkAccess): allowLocalNetworkAccess):
aboutFile = open(aboutFilename, "w+") aboutFile = open(aboutFilename, "w+")
@ -2931,8 +2930,6 @@ class PubServer(BaseHTTPRequestHandler):
if fields.get('editedTOS'): if fields.get('editedTOS'):
TOSStr = fields['editedTOS'] TOSStr = fields['editedTOS']
allowLocalNetworkAccess = \
self.server.allowLocalNetworkAccess
if not dangerousMarkup(TOSStr, if not dangerousMarkup(TOSStr,
allowLocalNetworkAccess): allowLocalNetworkAccess):
TOSFile = open(TOSFilename, "w+") TOSFile = open(TOSFilename, "w+")
@ -3348,7 +3345,7 @@ class PubServer(BaseHTTPRequestHandler):
baseDir: str, httpPrefix: str, baseDir: str, httpPrefix: str,
domain: str, domainFull: str, domain: str, domainFull: str,
onionDomain: str, i2pDomain: str, onionDomain: str, i2pDomain: str,
debug: bool) -> None: debug: bool, allowLocalNetworkAccess: bool) -> None:
"""Updates your user profile after editing via the Edit button """Updates your user profile after editing via the Edit button
on the profile screen on the profile screen
""" """
@ -3662,7 +3659,7 @@ class PubServer(BaseHTTPRequestHandler):
setTheme(baseDir, setTheme(baseDir,
fields['themeDropdown'], fields['themeDropdown'],
domain. domain.
self.server.allowLocalNetworkAccess) allowLocalNetworkAccess)
self.server.showPublishAsIcon = \ self.server.showPublishAsIcon = \
getConfigParam(self.server.baseDir, getConfigParam(self.server.baseDir,
'showPublishAsIcon') 'showPublishAsIcon')
@ -11763,7 +11760,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.domain, self.server.domain,
self.server.domainFull, self.server.domainFull,
self.server.onionDomain, self.server.onionDomain,
self.server.i2pDomain, self.server.debug) self.server.i2pDomain, self.server.debug,
self.server.allowLocalNetworkAccess)
return return
if authorized and self.path.endswith('/linksdata'): if authorized and self.path.endswith('/linksdata'):
@ -11773,7 +11771,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.domainFull, self.server.domainFull,
self.server.onionDomain, self.server.onionDomain,
self.server.i2pDomain, self.server.debug, self.server.i2pDomain, self.server.debug,
self.server.defaultTimeline) self.server.defaultTimeline,
self.server.allowLocalNetworkAccess)
return return
if authorized and self.path.endswith('/newswiredata'): if authorized and self.path.endswith('/newswiredata'):

View File

@ -2057,6 +2057,11 @@ fullWidthTimelineButtonHeader = \
if fullWidthTimelineButtonHeader is not None: if fullWidthTimelineButtonHeader is not None:
args.fullWidthTimelineButtonHeader = bool(fullWidthTimelineButtonHeader) args.fullWidthTimelineButtonHeader = bool(fullWidthTimelineButtonHeader)
allowLocalNetworkAccess = \
getConfigParam(baseDir, 'allowLocalNetworkAccess')
if allowLocalNetworkAccess is not None:
args.allowLocalNetworkAccess = bool(allowLocalNetworkAccess)
YTDomain = getConfigParam(baseDir, 'youtubedomain') YTDomain = getConfigParam(baseDir, 'youtubedomain')
if YTDomain: if YTDomain:
if '://' in YTDomain: if '://' in YTDomain: