aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-07-16 01:07:00 -0700
committerfriendica <info@friendica.com>2014-07-16 01:07:00 -0700
commit3a31ddea2b516cebe60c6ac096516db8df101fd0 (patch)
tree55ff5e01ec3035b0a8ade9e0731bd7d1b51e7794 /include
parent0435a08f3bafe47e0fe0cda6e698f93a5fab26e6 (diff)
downloadvolse-hubzilla-3a31ddea2b516cebe60c6ac096516db8df101fd0.tar.gz
volse-hubzilla-3a31ddea2b516cebe60c6ac096516db8df101fd0.tar.bz2
volse-hubzilla-3a31ddea2b516cebe60c6ac096516db8df101fd0.zip
provide os_mkdir to workaround permission issues with php mkdir
Diffstat (limited to 'include')
-rw-r--r--include/attach.php4
-rw-r--r--include/security.php2
-rwxr-xr-xinclude/smarty.php6
3 files changed, 8 insertions, 4 deletions
diff --git a/include/attach.php b/include/attach.php
index da22e8ed5..0df2e82a5 100644
--- a/include/attach.php
+++ b/include/attach.php
@@ -579,7 +579,7 @@ function attach_mkdir($channel, $observer_hash, $arr = null) {
logger('attach_mkdir: basepath: ' . $basepath);
if(! is_dir($basepath))
- mkdir($basepath,STORAGE_DEFAULT_PERMISSIONS, true);
+ os_mkdir($basepath,STORAGE_DEFAULT_PERMISSIONS, true);
if(! perm_is_allowed($channel_id, $observer_hash, 'write_storage')) {
$ret['message'] = t('Permission denied.');
@@ -665,7 +665,7 @@ function attach_mkdir($channel, $observer_hash, $arr = null) {
);
if($r) {
- if(mkdir($path, STORAGE_DEFAULT_PERMISSIONS, true)) {
+ if(os_mkdir($path, STORAGE_DEFAULT_PERMISSIONS, true)) {
$ret['success'] = true;
$ret['data'] = $arr;
diff --git a/include/security.php b/include/security.php
index aaf4eb050..2ccfc6973 100644
--- a/include/security.php
+++ b/include/security.php
@@ -96,7 +96,7 @@ function change_channel($change_channel) {
get_app()->set_perms(get_all_perms(local_user(),$hash));
}
if(! is_dir('store/' . $r[0]['channel_address']))
- @mkdir('store/' . $r[0]['channel_address'], STORAGE_DEFAULT_PERMISSIONS,true);
+ @os_mkdir('store/' . $r[0]['channel_address'], STORAGE_DEFAULT_PERMISSIONS,true);
}
diff --git a/include/smarty.php b/include/smarty.php
index c2fcc4097..99f143db1 100755
--- a/include/smarty.php
+++ b/include/smarty.php
@@ -49,8 +49,12 @@ class FriendicaSmartyEngine implements ITemplateEngine {
public function __construct(){
$a = get_app();
+
+ // Cannot use get_config() here because it is called during installation when there is no DB.
+ // FIXME: this may leak private information such as system pathnames.
+
$basecompiledir = ((array_key_exists('smarty3_folder',$a->config['system'])) ? $a->config['system']['smarty3_folder'] : '');
- if (!$basecompiledir) $basecompiledir = dirname(__dir__)."/store/[data]/smarty3";
+ if (!$basecompiledir) $basecompiledir = dirname(__dir__) . "/" . TEMPLATE_BUILD_PATH;
if (!is_dir($basecompiledir)) {
echo "<b>ERROR:</b> folder <tt>$basecompiledir</tt> does not exist."; killme();
}