Skip to content

Commit 90efaa0

Browse files
committed
feat(general): updates for 0.9
1 parent 1ee9bd5 commit 90efaa0

29 files changed

+61
-42
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

app/Appwrite/services/functions.php renamed to app/functions.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -308,14 +308,15 @@
308308
$params = [];
309309
/** Body Params */
310310
$params['command'] = $command;
311-
$cloudFunctionPath = realpath(__DIR__.'/../../../files/'.$code);
312-
$cloudFunctionParentDir = dirname($cloudFunctionPath, 1);
313-
$cloudFunctionDirName = basename($cloudFunctionPath);
311+
$code = \urldecode($code);
312+
$cloudFunctionPath = realpath(__DIR__.'/../files/'.$code);
313+
$cloudFunctionParentDir = escapeshellarg(dirname($cloudFunctionPath, 1));
314+
$cloudFunctionDirName = escapeshellarg(basename($cloudFunctionPath));
314315
if (file_exists($cloudFunctionPath) === false ) {
315316
throw new Exception("Path doesn't exist. Please ensure that the path is within the current directory. ");
316317
}
317318
$archiveName = 'code.tar.gz';
318-
$volumeMountPoint = realpath(__DIR__.'/../../../files/');
319+
$volumeMountPoint = realpath(__DIR__.'/../files/');
319320
exec("tar -zcvf $archiveName -C $cloudFunctionParentDir $cloudFunctionDirName && mv $archiveName $volumeMountPoint");
320321
$archivePath = realpath($volumeMountPoint."/$archiveName");
321322
$cFile = new \CURLFile($archivePath, 'application/x-gzip' , basename($archivePath));
File renamed without changes.
File renamed without changes.

app/Appwrite/services/init.php renamed to app/init.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use Utopia\CLI\Console;
1111
use Appwrite\Parser;
1212

13-
const USER_PREFERENCES_FILE = __DIR__."/../../.preferences/.prefs.json";
13+
const USER_PREFERENCES_FILE = __DIR__."/.preferences/.prefs.json";
1414
const PREFERENCE_ENDPOINT = "endpoint";
1515

1616
/**
File renamed without changes.

app/Appwrite/services/storage.php renamed to app/storage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
$path = str_replace([], [], '/storage/files');
8585
$params = [];
8686
/** Body Params */
87-
$file = realpath(__DIR__.'/../../../files/'.$file);
87+
$file = realpath(__DIR__.'/../files/'.\urldecode($file));
8888
if (file_exists($file) === false ) {
8989
throw new Exception("Path doesn't exist. Please ensure that the path is within the current directory. ");
9090
}

0 commit comments

Comments
 (0)