Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornachoparker <nacho@ownyourbits.com>2018-02-21 21:56:28 +0300
committernachoparker <nacho@ownyourbits.com>2018-02-21 21:57:41 +0300
commit8389ac7386d6b4ad386487d9645e6c21e9656d9a (patch)
tree4a8190f463c2b5a522eaa31bc6f59032d50113ca
parent8d100b9d8716392ae8c845f25c2178f838dd19a7 (diff)
ncp-web: fix backend request without argumentsv0.46.25
-rw-r--r--ncp-web/ncp-launcher.php19
1 files changed, 10 insertions, 9 deletions
diff --git a/ncp-web/ncp-launcher.php b/ncp-web/ncp-launcher.php
index 318caa7a..7e905e7c 100644
--- a/ncp-web/ncp-launcher.php
+++ b/ncp-web/ncp-launcher.php
@@ -84,15 +84,16 @@ else if ( $_POST['action'] == "launch" && $_POST['config'] )
$code = file_get_contents( $file )
or exit( '{ "output": "' . $file . ' read error" }' );
- foreach( $params as $name => $value)
- {
- preg_match( '/^[\w.,@_\/-]+$/' , $value , $matches )
- or exit( '{ "output": "Invalid input" , "token": "' . getCSRFToken() . '" }' );
- $code = preg_replace( '/\n' . $name . '_=.*' . PHP_EOL . '/' ,
- PHP_EOL . $name . '_=' . $value . PHP_EOL ,
- $code )
- or exit();
- }
+ if ( !empty( $params ) )
+ foreach( $params as $name => $value )
+ {
+ preg_match( '/^[\w.,@_\/-]+$/' , $value , $matches )
+ or exit( '{ "output": "Invalid input" , "token": "' . getCSRFToken() . '" }' );
+ $code = preg_replace( '/\n' . $name . '_=.*' . PHP_EOL . '/' ,
+ PHP_EOL . $name . '_=' . $value . PHP_EOL ,
+ $code )
+ or exit();
+ }
file_put_contents($file, $code )
or exit( '{ "output": "' . $file . ' write error" }' );