Commit graph

22374 commits

Author SHA1 Message Date
Morris Jobke
c91d47e5b3 Merge pull request #13224 from owncloud/simplify-is-valid-path-and-add-unit-tests
Simplify isValidPath and add unit tests
2015-01-10 17:35:40 +01:00
Morris Jobke
c259733b88 Merge pull request #13223 from owncloud/optimize-normalize-unicode
Verify whether value is already normalized
2015-01-10 16:33:54 +01:00
Morris Jobke
8057bc6646 Merge pull request #13236 from owncloud/use-isset-for-performance
Use isset() instead of strlen()
2015-01-10 16:32:50 +01:00
Morris Jobke
74d1a9ea3d Merge pull request #13235 from owncloud/cache-normalize-path
Cache results of `normalizePath`
2015-01-10 16:32:09 +01:00
Morris Jobke
49ed2ebb2c Merge pull request #13225 from owncloud/add-csrf-check
Add CSRF check to search
2015-01-10 16:31:45 +01:00
Lukas Reschke
e80ece9a2b Verify whether value is already normalized
Apparently `normalizer_normalize` is not verifying itself whether the string needs to be converted or not. Or does it at least not very performantly.

This simple change leads to a 4% performance gain on the processing of normalizeUnicode. Since this method is called quite often (i.e. for every file path) this has actually a measurable impact. For examples searches are now 200ms faster on my machine. Still not perfect but way to go.

Part of https://github.com/owncloud/core/issues/13221
2015-01-10 12:12:40 +01:00
Lukas Reschke
310424db5d Use isset() instead of strlen()
Isset is a native language construct and thus A LOT faster than using strlen()

On my local machine this leads to a 1s performance gain for about 1 million paths. Considering that this function will be called a lot for every file operation this makes a noticable difference.
2015-01-10 12:06:51 +01:00
Lukas Reschke
7e11ca06f6 Cache results of normalizePath
`normalizePath` is a rather expensive operation and called multiple times for a single path for every file related operation.

In my development installation with about 9GB of data and 60k files this leads to a performance boost of 24% - in seconds that are 1.86s (!) - for simple searches. With more files the impact will be even more noticeable. Obviously this affects every operation that has in any regard something to do with using OC\Files\Filesystem.

Part of https://github.com/owncloud/core/issues/13221
2015-01-10 11:10:38 +01:00
Morris Jobke
ae3483299c Merge pull request #13212 from owncloud/cache-appstore-response
Cache responses from the AppStore server
2015-01-10 09:56:00 +01:00
Jenkins for ownCloud
22e5220c1f [tx-robot] updated from transifex 2015-01-10 01:54:35 -05:00
Lukas Reschke
e4840b5250 Don't double encode string
We already use `.text()` here which automatically properly encodes the string. Thus the string will be double-encoded and look ugly. (i.e. when you search for ">" you will see "No results found for >")

Fixes itself.
2015-01-10 01:19:37 +01:00
Lukas Reschke
19b7911d79 Fix URL to developer manual 2015-01-10 00:54:38 +01:00
Lukas Reschke
05615bfd47 Simplify isValidPath and add unit tests
The check for invalid paths is actually over-complicated and performed twice resulting in a performance penalty. Additionally, I decided to add unit-tests to that function.

Part of https://github.com/owncloud/core/issues/13221
2015-01-10 00:40:21 +01:00
Lukas Reschke
8ae1478288 Add CSRF check to search
Doesn't hurt to have a check on this one as well.
2015-01-10 00:30:14 +01:00
Lukas Reschke
5f31207e84 Add some more sanity checks for maintenance mode 2015-01-09 21:52:16 +01:00
Lukas Reschke
1c75b73239 Verify authentication before initializing apps and routing
The current behaviour of the authenticion logic in base.php prevents REST APIs in ownCloud applications to work.

Because `!self::$CLI` is usually always a true statement the previously above block was entered which returned, thus the authentication logic for this part does not trigger in.

This can be reproduced by installing apps such as the News app and issuing the following command:

`curl -u admin:admin http://localhost/index.php/apps/news/api/v1-2/feeds`

The following parts needs to get throughly tested:

- [ ] OCS
- [ ] remote.php's DAV features
- [ ] Regular login features

This bug affects master and stable7. I'd propose that we merge this for 8.0 since this has the potential to break every component that relies on Basic Auth features. A backport would also be very nice.

Remark to myself: We really need to move out the authentication code for 8.1 out of base.php - I already have a local branch that does that somewhere which I will get in shape for 8.1... - This untested code is a night-mare.

Fixes itself.
2015-01-09 21:07:29 +01:00
Lukas Reschke
b8b4df5425 Cache responses from the AppStore server
Otherwise every time the AppStore was opened a lot of connections to the AppStore server were made which resulted in a terrible performance.

This changeset will cache the response for a sensible time so that only the first request will be somewhat slow.

Performance changes:
- Loading a category took previously more than 3 seconds on my machine. Now for every follow-up request it takes less than 200ms, resulting in a performance gain of 1950%
- Loading the category list took previously about 750ms - now it takes 154ms, a total performance gain of 395%
2015-01-09 19:49:59 +01:00
Vincent Petry
59a1d16d0f Merge pull request #13204 from owncloud/enc_fix_key_lost
Encryption fix key lost if group share gets renamed
2015-01-09 18:40:51 +01:00
Morris Jobke
da8228fa14 Merge pull request #13195 from owncloud/resharepermfix
Fix reshare permission issue
2015-01-09 18:05:05 +01:00
Thomas Müller
9fb61b42f6 Merge pull request #13208 from owncloud/hhvm-streamwrapper-exception
HHVM Workaround: Do not use Exception from Stream.
2015-01-09 18:02:28 +01:00
Thomas Müller
d4355cafc6 Merge pull request #13192 from owncloud/cache_binary_path
Use memcache for findBinaryPath
2015-01-09 17:46:36 +01:00
Lukas Reschke
f65cf498f4 Check for existence of $_GET keys
Otherwise PHP errors are thrown in the error log.
2015-01-09 17:46:14 +01:00
Andreas Fischer
df849bb69a HHVM Workaround: Do not use Exception from Stream.
Works around https://github.com/facebook/hhvm/issues/2436#issuecomment-69351373
2015-01-09 17:01:17 +01:00
Thomas Müller
b1031c6355 Merge pull request #13188 from owncloud/add-check-if-user-is-logged-in
Add check if user is logged-in
2015-01-09 16:45:53 +01:00
Robin Appelman
cd79b0279a Merge pull request #13196 from owncloud/js-personal-no-password
Fix js error in personal settings if there is no password field
2015-01-09 16:45:32 +01:00
Thomas Müller
847dd6d04c Merge pull request #13205 from owncloud/remove-shared-icon
replace outdated 'shared' people icon with regular share icon as fallback
2015-01-09 16:40:26 +01:00
Jan-Christoph Borchardt
c26e669c4c replace outdated 'shared' people icon with regular share icon as fallback 2015-01-09 16:18:42 +01:00
Bjoern Schiessle
0500d3a506 unit tests 2015-01-09 15:49:44 +01:00
Bjoern Schiessle
6cc40552b1 don't move encryption keys if a mount point was renamed 2015-01-09 15:39:36 +01:00
Robin Appelman
22ab56a592 Fix js error in personal settings if there is no password field 2015-01-09 15:38:39 +01:00
Vincent Petry
c897a14d56 Fix reshare permission issue
The actual share permissions sent to the server on reshare are now based
on possiblePermissions + permissions inherited from parent share
2015-01-09 15:19:53 +01:00
Robin McCorkell
631d6571fd Merge pull request #13181 from owncloud/filecache-preventleadingslash
Trim leading or trailing slashes in file cache paths
2015-01-09 13:54:17 +00:00
Morris Jobke
800738f51a Merge pull request #12011 from owncloud/reuse-etag-default
Default to reusing etags in the scanner
2015-01-09 14:38:45 +01:00
Robin McCorkell
c291383116 Memcache binary executable searching
It's slow, this makes it fast!
2015-01-09 13:18:00 +00:00
Robin McCorkell
17dd5d0816 Add Null memcacher 2015-01-09 13:18:00 +00:00
Thomas Müller
1f1643b35f Merge pull request #12995 from owncloud/tbelau666-master
Use Doctrines filter by table name
2015-01-09 14:17:14 +01:00
Morris Jobke
d2ca9e9c0f Merge pull request #13191 from owncloud/fix-rename-field
fix rename field position, fix #12927
2015-01-09 13:16:37 +01:00
Jan-Christoph Borchardt
720fe858a3 fix rename field position, fix #12927 2015-01-09 13:05:22 +01:00
Bjoern Schiessle
d699d31518 make versions of shared files downloadable 2015-01-09 12:46:24 +01:00
Lukas Reschke
1cfcec8684 Add check if user is logged-in
Otherwise a fatal PHP error is thrown since the filesystem is not setup:
```
( ! ) Fatal error: Call to a member function getOwner() on null in /Users/lreschke/Programming/core/lib/private/files/filesystem.php on line 817
Call Stack
1	0.0004	247792	{main}( )	../index.php:0
2	0.0946	5088776	OC::handleRequest( )	../index.php:28
3	0.1423	7491280	OC\Route\Router->match( )	../base.php:748
4	0.1664	8592152	call_user_func:{/Users/lreschke/Programming/core/lib/private/route/router.php:250} ( )	../router.php:250
5	0.1664	8592216	__lambda_func( )	../router.php:250
6	0.1665	8599064	require_once( '/Users/lreschke/Programming/core/apps/files_versions/ajax/getVersions.php' )	../route.php(135) : runtime-created function:1
7	0.1801	9061096	OCA\Files_Versions\Storage::getUidAndFilename( )	../getVersions.php:7
8	0.1801	9061144	OC\Files\Filesystem::getOwner( )	../storage.php:45
```

Furthermore this adds the CSRF check as a nice-to-have addition, the requests accessing this are done via the jQuery AJAX methods and thus the header is automatically added to all requests already.
2015-01-09 11:55:18 +01:00
Jörn Friedrich Dreyer
45a20744fc add js tests for filelist filtering 2015-01-09 10:49:22 +01:00
Lukas Reschke
a5099b01f9 Merge pull request #12984 from owncloud/ldap-user-cleanup-master
Ldap user cleanup master
2015-01-09 10:47:02 +01:00
Lukas Reschke
b4606ec24f Merge pull request #13184 from owncloud/fix-key
Verify existence of $_GET key
2015-01-09 10:39:22 +01:00
Vincent Petry
888ce4d4f9 Fix cache jail to not duplicate slashes 2015-01-09 10:18:32 +01:00
Jenkins for ownCloud
d4fc2f555b [tx-robot] updated from transifex 2015-01-09 01:55:22 -05:00
Lukas Reschke
199276bcbb Verify existence of $_GET key
Otherwise when the file without any specified mimetype was accessed the error log was flooded with entries such as "Undefined index: mime", there can be multiple issues found about this in the forum and our bugtracker.

To test this access `/index.php/apps/files/ajax/mimeicon.php` with and without `$_GET['mime']`.

Fixes itself.
2015-01-09 02:31:59 +01:00
Lukas Reschke
6c59253978 Merge pull request #13179 from owncloud/fix-fatal-php-error-for-not-existing-files
Verify whether type is correct
2015-01-09 02:27:51 +01:00
Morris Jobke
6a5f12beca Merge pull request #12988 from owncloud/logfile_download
Logfile download
2015-01-09 00:33:22 +01:00
Vincent Petry
aa821ecc00 Trim leading or trailing slashes in file cache paths 2015-01-08 19:43:02 +01:00
Lukas Reschke
ceaaab6295 Verify whether type is correct
`$this->info` can very well contain an empty array or possibly other values. This means that when this code path is called a PHP Fatal error might get thrown which is not what we want.
2015-01-08 18:38:17 +01:00