diff options
author | Andrew Manning <tamanning@zoho.com> | 2016-07-16 19:25:44 -0400 |
---|---|---|
committer | Andrew Manning <tamanning@zoho.com> | 2016-07-16 19:25:44 -0400 |
commit | ff2f599142348162b6459a02aa014c7dbca84f76 (patch) | |
tree | 2a83c061a614e7af65cb8120489b62df5e75e63c /Zotlabs/Module/Webpages.php | |
parent | 0edf248cd1f49cb7e4b44744629355e9e165ce64 (diff) | |
download | volse-hubzilla-ff2f599142348162b6459a02aa014c7dbca84f76.tar.gz volse-hubzilla-ff2f599142348162b6459a02aa014c7dbca84f76.tar.bz2 volse-hubzilla-ff2f599142348162b6459a02aa014c7dbca84f76.zip |
Postpone remote folder import until filesystem mirroring matures.
Diffstat (limited to 'Zotlabs/Module/Webpages.php')
-rw-r--r-- | Zotlabs/Module/Webpages.php | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/Zotlabs/Module/Webpages.php b/Zotlabs/Module/Webpages.php index 766b4fc09..16ecb5386 100644 --- a/Zotlabs/Module/Webpages.php +++ b/Zotlabs/Module/Webpages.php @@ -211,7 +211,7 @@ class Webpages extends \Zotlabs\Web\Controller { function post() { - if(($_FILES) && array_key_exists('zip_file',$_FILES)) { + if(($_FILES) && array_key_exists('zip_file',$_FILES) && isset($_POST['w_upload'])) { $source = $_FILES["zip_file"]["tmp_name"]; $type = $_FILES["zip_file"]["type"]; $okay = false; @@ -256,7 +256,41 @@ class Webpages extends \Zotlabs\Web\Controller { if($elements) { rrmdir($website); // Delete the temporary decompressed files } - } + } + + return null; + } + + if (($_POST) && array_key_exists('url',$_POST) && isset($_POST['remotesubmit'])) { + $ret = []; + // Warning: Do not edit the following line. The first symbol is UTF-8 @ + $url = str_replace('@','@',notags(trim($_REQUEST['url']))); + if(! allowed_url($url)) { + $ret['message'] = t('Channel is blocked on this site.'); + return null; + } + + $h = @parse_url($url); + + if(! $h || !x($h, 'host') || !x($h, 'path')) { + return null; + } + if(substr($h['path'],-1,1) === '/') { + $h['path'] = substr($h['path'],0,-1); + } + if(substr($h['path'],0,1) === '/') { + $h['path'] = substr($h['path'],1); + } + $folders = explode('/', $h['path']); + if(!(array_shift($folders) === 'cloud')) { + return null; + } + $nick = array_shift($folders); + if(!$nick) { + return null; + } + return null; + } } |