diff options
-rw-r--r-- | apps/files/js/files.js | 3 | ||||
-rwxr-xr-x | apps/user_webdavauth/templates/settings.php | 4 | ||||
-rw-r--r-- | lib/helper.php | 28 |
3 files changed, 8 insertions, 27 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js index bb298431e84..a4260c43285 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -87,8 +87,8 @@ $(document).ready(function() { // Sets the file link behaviour : $('td.filename a').live('click',function(event) { - event.preventDefault(); if (event.ctrlKey || event.shiftKey) { + event.preventDefault(); if (event.shiftKey) { var last = $(lastChecked).parent().parent().prevAll().length; var first = $(this).parent().parent().prevAll().length; @@ -130,6 +130,7 @@ $(document).ready(function() { var permissions = $(this).parent().parent().data('permissions'); var action=FileActions.getDefault(mime,type, permissions); if(action){ + event.preventDefault(); action(filename); } } diff --git a/apps/user_webdavauth/templates/settings.php b/apps/user_webdavauth/templates/settings.php index 62ed45fd278..880b77ac959 100755 --- a/apps/user_webdavauth/templates/settings.php +++ b/apps/user_webdavauth/templates/settings.php @@ -1,8 +1,8 @@ <form id="webdavauth" action="#" method="post"> <fieldset class="personalblock"> - <legend><strong>WebDAV Authentication</strong></legend> + <legend><strong><?php echo $l->t('WebDAV Authentication');?></strong></legend> <p><label for="webdav_url"><?php echo $l->t('URL: http://');?><input type="text" id="webdav_url" name="webdav_url" value="<?php echo $_['webdav_url']; ?>"></label> <input type="submit" value="Save" /> - <br /><?php echo $l->t('ownCloud will send the user credentials to this URL is interpret http 401 and http 403 as credentials wrong and all other codes as credentials correct.'); ?> + <br /><?php echo $l->t('ownCloud will send the user credentials to this URL. This plugin checks the response and will interpret the HTTP statuscodes 401 and 403 as invalid credentials, and all other responses as valid credentials.'); ?> </fieldset> </form> diff --git a/lib/helper.php b/lib/helper.php index 1aba2a38100..e7c9ac8015d 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -625,37 +625,17 @@ class OC_Helper { return $newpath; } - /* - * checks if $sub is a subdirectory of $parent + /** + * @brief Checks if $sub is a subdirectory of $parent * * @param string $sub * @param string $parent * @return bool */ public static function issubdirectory($sub, $parent) { - if($sub == null || $sub == '' || $parent == null || $parent == '') { - return false; - } - $realpath_sub = realpath($sub); - $realpath_parent = realpath($parent); - if(($realpath_sub == false && substr_count($realpath_sub, './') != 0) || ($realpath_parent == false && substr_count($realpath_parent, './') != 0)) { //it checks for both ./ and ../ - return false; - } - if($realpath_sub && $realpath_sub != '' && $realpath_parent && $realpath_parent != '') { - if(substr($realpath_sub, 0, strlen($realpath_parent)) == $realpath_parent) { - return true; - } - }else{ - if(substr($sub, 0, strlen($parent)) == $parent) { - return true; - } + if (strpos(realpath($sub), realpath($parent)) === 0) { + return true; } - /*echo 'SUB: ' . $sub . "\n"; - echo 'PAR: ' . $parent . "\n"; - echo 'REALSUB: ' . $realpath_sub . "\n"; - echo 'REALPAR: ' . $realpath_parent . "\n"; - echo substr($realpath_sub, 0, strlen($realpath_parent)); - exit;*/ return false; } |