[BUGFIX] PublicURL calculation for storage 0 is wrong

Since the refactoring of the publicURL Feature and the possibility to
link to files via jump-scripts the generation of publicUrls for files
in storage zero is broken due to the fact that every relative base-path
for this URL is appended with a slash.

If the base-path has been empty (like for storage 0), appending a slash
makes it absolute.

This patch changes the behaviour to only append a slash on non-empty
paths.

Releases: 6.2
Resolves: #56927
Change-Id: I14e8bae0b64ed8dc537a5edbf57d9dce6ddf0932
Reviewed-on: https://review.typo3.org/28395
Reviewed-by: Alexander Stehlik
Tested-by: Alexander Stehlik
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
[TASK] Improve Locker

Code cleanup for locker and fix of semaphore locking.
It is now possible to reuse a semaphore.

Resolves: #40420
Releases: 6.2
Change-Id: I843aca1f9fa3d070ce0a508a27d3c433725991fa
Reviewed-on: https://review.typo3.org/28159
Reviewed-by: Thomas Maroschik
Tested-by: Thomas Maroschik
[BUGFIX] Tests: Incomplete Mocking in ext:extensionmanager

After the removal of GLOBALS initialisation the extension raises
warnings in unittests.

Change-Id: I450932b1de1852302e4ae9861b250c5721f6032e
Resolves: #56930
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28412
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Thomas Maroschik
Tested-by: Thomas Maroschik
[BUGFIX] Implement locking in ClassLoader

After cache clearing we can run in the situation that 2 processes will
rebuild the ClassLoader cache which will lead to a non useable cache,
which produces fatals. As the data is generated more than once the load
of the server increases per request while ClassLoader cache is build.

The implemented Locking will stop this issue. Every process waits till
the first is ready and then looks if data was generated and stops re-
generating the cache.

Resolves: #55099
Releases: 6.2
Change-Id: I109821b9c37ec99c5ec5dbc5bcef6223d1d0d153
Reviewed-on: https://review.typo3.org/28156
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Thomas Maroschik
Tested-by: Thomas Maroschik
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
[BUGFIX] Tests: Improve mocking in ext:extbase

Unit tests reveal some warnings which are caused by incomplete
mocking. They all belong to $GLOBALS['LANG']

Change-Id: Ic2adda9984a530b82e259c1d8931015996f167ba
Resolves: #56700
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28407
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
[BUGFIX] Follow-up: .t3-table & .dblist-table

Fixes different headers and columns paddings for .t3-table
and the former .typo3-dblist. Also fixes .row-header link
hover style where text links went black and dark gray.

Resolves: #56926
Releases: 6.2
Change-Id: I0e93ccc315f4740b87be7656df1d54cd40272be7
Reviewed-on: https://review.typo3.org/28406
Reviewed-by: Marcin Sągol
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
[TASK] Tests: Refactor cache Typo3DatabaseBackend

Tests of the Typo3DatabaseBackend are refactored to not depend on
initialized $GLOBALS['TYPO3_DB'] anymore, queries and quoting is
now performed to a mock object. Next to a better separation this
has the advantage of a nice speedup executing those tests.

Change-Id: I8fc23fec56a50e48f74422eac3ee4a07ed3669b9
Resolves: #56937
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28420
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
[BUGFIX] Tests: Improve mocking in DatabaseConnectionTest

With the switch to mysqli object it is now possible to fully mock
and check the final database calls in DatabaseConnectionTest, the
test table can be removed after refactoring the tests.

Change-Id: I60e33f6af5b4be8111a21469d12e38843650e7c4
Resolves: #56938
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28422
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
[TASK] inline BEUserAuth::getCookieName

During bootstrapping in index_ts.php there is a check
for an existing be_typo_user cookie which enables
TimeTracking. The simple static getter triggers the loading
and parsing of BackendUserAuthentication and
AbstractUserAuthentication which are both pretty fat classes
and have an impact upon eID calls and frontend calls.

This patch inlines the cookie name retrieval and defers thus
the loading of the fat classes.

Resolves: #56316
Releases: 6.2
Change-Id: I5ce5cf92095dcb8820fb0e548e16e38a99f4f12e
Reviewed-on: https://review.typo3.org/28418
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
[BUGFIX] Tests: Incomplete mock in IndexerServiceTest

Change-Id: Idad4b11894ee6e09e0b8eca9a057c7a776925a70
Resolves: #56939
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28423
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
[TASK] Remove old hook for simulatestatic

The hook was introduced and deprecated when
simulatestatic was moved to TER for 6.0.

Furthermore the old wapversion.lib files are
not part of the Core anymore, hence we can remove
some more overhead.

Resolves: #56491
Releases: 6.2
Change-Id: Ib9c05895eed3539ac9e540b39d720038c5cacedb
Reviewed-on: https://review.typo3.org/27991
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
[TASK] Tests: Skip some FAL tests

While the FAL tests were already streamlined and simplified a lot,
the ResourceStorageTest class is still a mixture of functional and
unit test that involves heavy set up code and still does not mock
dependencies properly.
This test class needs a rewrite and a clean separation of units
together with a number of working functional tests to be of any use.
For now, all tests that rely on initialized database are skipped and
marked as TODO.

Change-Id: I3191c809c50f4f19ab91b9a5b5f2f3ebc3fa47ff
Resolves: #56940
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28424
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Revert "[BUGFIX] Implement locking in ClassLoader"

This reverts commit 76284d26065af1a0a5b141f5f16305a5821609fa

The implemented locking is fine, but currently breaks a fresh new
installation (when there is no typo3temp directory yet). We remove
this feature for the release of beta7 and merge it afterwards again
to be able to improve upon it during the next week before the release
candidate.

Change-Id: Ie69352e5c7e3a224b0a0c71457efe3dbb8d90aac
Reviewed-on: https://review.typo3.org/28426
Reviewed-by: Ernesto Baschny
Tested-by: Ernesto Baschny
[BUGFIX] Tests: Release em tests from extbase base class

Extbase BaseTestClass comes with a not mocked objectManager that
gives headaches if it is injected to a test subject. Releasing
the extensionmanager test classes from this and using core
UnitTestCase as parent reveals these parts in existing tests,
those are fixed with the patch.

Change-Id: Ia7acd7f838f9ac0eb2f44e0737893fc30c41ff55
Resolves: #56942
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28427
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
[TASK] Tests: Release ext:form tests from exbase base class

Change-Id: I7e9f09fa747a07208bf248aa35fdf154cd1fa9c4
Resolves: #56943
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/28428
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
[BUGFIX] Index on sys_file_processedfile is still too large

On some systems even "332" characters is too large. To also cope with
potential utf8mb4 setups (1 char = 4 bytes), and staying under 1000 byte
limit, we reduce the amount of characters in the index to 249.

Resolves: #56786
Related: #54234
Releases: 6.2
Change-Id: I79452224f37ec2b6ca5b3a35044144eed787df67
Reviewed-on: https://review.typo3.org/28429
Reviewed-by: Ernesto Baschny
Tested-by: Ernesto Baschny
[TASK] Install Tool: Optimize permission checking and fixing

* Adjust default permissions back to "world readable" (775/664)
* Do not attempt to fix permissions on an existing folder structure
* Streamline the separation of Notices, Warnings and Errors
* Cosmetical optimizations in the "Folder Structure" item
* Also report if the default permissions are too insecure (i.e.
  world writeable / readable).

Note that the new defaults (775/664) are set to make the system work
by default on almost most scenarios, but the recommended secure setup
is still 770/660. This is on purpose to make the administrator aware
of it but will require manual intervention (i.e. "thinking") if this
setup will work or not (we cannot detect that automatically).

Resolves: #52668
Releases: 6.2
Change-Id: I77c72617fa58fd808ebc5fd818e94b48c2644102
Reviewed-on: https://review.typo3.org/25416
Reviewed-by: Christian Kuhn
Reviewed-by: Wouter Wolters
Reviewed-by: Stefan Neufeind
Reviewed-by: Philipp Gampe
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Ernesto Baschny
Tested-by: Ernesto Baschny
[BUGFIX] FAL: Invalid title and broken layout

This fix resolves the issue of the wrong title for FAL irre relations.
Now the title of the sys_file metadata will be displayed,
if there's no title for the sys_file_reference.
Additionally the title, labels and placeholder
will be cropped if necessary.

Resolves: #55485
Releases: 6.2
Change-Id: I22b41931e10c565d83edb53ab9689311d13e811a
Reviewed-on: https://review.typo3.org/27259
Reviewed-by: Steffen Ritter
Reviewed-by: Frans Saris
Tested-by: Frans Saris
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
[BUGFIX] Prevent IconUtility to throw PHP Warning

Do an array typecast while using function in_array()
Clean up the code to make it more clear

Change-Id: I97738ab4bc4e1e4c346cd25836e2b4d1f875ec23
Resolves: #56558
Releases: 6.2, 6.1
Reviewed-on: https://review.typo3.org/28065
Reviewed-by: Oliver Klee
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
[TASK] version entry script cleanup

The patch adds usage of module dispatcher to enable CSRF protection to
version click module.

Resolves: #55675
Releases: 6.2
Change-Id: Ib31e419fd2a880052e93f3eea95d51c75d442e23
Reviewed-on: https://review.typo3.org/28209
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Stefan Neufeind
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring