mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-20 10:34:30 +00:00
sharing: put file path between quotation marks
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
e8b224982f
commit
0b2125aad6
@ -57,7 +57,7 @@ def load_augeas():
|
|||||||
def subcommand_add(arguments):
|
def subcommand_add(arguments):
|
||||||
"""Add a share to Apache configuration."""
|
"""Add a share to Apache configuration."""
|
||||||
name = arguments.name
|
name = arguments.name
|
||||||
path = arguments.path
|
path = '"' + arguments.path + '"'
|
||||||
groups = arguments.groups
|
groups = arguments.groups
|
||||||
is_public = arguments.is_public
|
is_public = arguments.is_public
|
||||||
url = '/share/' + name
|
url = '/share/' + name
|
||||||
@ -154,7 +154,7 @@ def _list(aug=None):
|
|||||||
name = _get_name_from_url(url)
|
name = _get_name_from_url(url)
|
||||||
shares.append({
|
shares.append({
|
||||||
'name': name,
|
'name': name,
|
||||||
'path': path,
|
'path': path.strip('"'),
|
||||||
'url': '/share/' + name
|
'url': '/share/' + name
|
||||||
})
|
})
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
|||||||
@ -20,8 +20,9 @@ class AddShareForm(forms.Form):
|
|||||||
'A lowercase alpha-numeric string that uniquely identifies a '
|
'A lowercase alpha-numeric string that uniquely identifies a '
|
||||||
'share. Example: <em>media</em>.'))
|
'share. Example: <em>media</em>.'))
|
||||||
|
|
||||||
path = forms.CharField(
|
path = forms.RegexField(
|
||||||
label=_('Path to share'), strip=True, help_text=_(
|
label=_('Path to share'), strip=True, regex=r'^[^\"]+$',
|
||||||
|
help_text=_(
|
||||||
'Disk path to a folder on this server that you intend to share.'))
|
'Disk path to a folder on this server that you intend to share.'))
|
||||||
|
|
||||||
is_public = forms.BooleanField(
|
is_public = forms.BooleanField(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user