Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
7998689b
Unverified
Commit
7998689b
authored
8 years ago
by
Roeland Jago Douma
Browse files
Options
Downloads
Patches
Plain Diff
Added method to DB and fix test
Signed-off-by:
Roeland Jago Douma
<
roeland@famdouma.nl
>
parent
3a8e75a8
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/private/AppFramework/Db/Db.php
+11
-0
11 additions, 0 deletions
lib/private/AppFramework/Db/Db.php
tests/lib/Files/PathVerificationTest.php
+8
-2
8 additions, 2 deletions
tests/lib/Files/PathVerificationTest.php
with
19 additions
and
2 deletions
lib/private/AppFramework/Db/Db.php
+
11
−
0
View file @
7998689b
...
...
@@ -31,6 +31,7 @@ use OCP\DB\QueryBuilder\IQueryBuilder;
use
OCP\IDb
;
use
OCP\IDBConnection
;
use
OCP\PreConditionNotMetException
;
use
Doctrine\DBAL\Platforms\MySqlPlatform
;
/**
* @deprecated use IDBConnection directly, will be removed in ownCloud 10
...
...
@@ -300,4 +301,14 @@ class Db implements IDb {
public
function
escapeLikeParameter
(
$param
)
{
return
$this
->
connection
->
escapeLikeParameter
(
$param
);
}
/**
* Check whether or not the current database support 4byte wide unicode
*
* @return bool
* @since 9.2.0
*/
public
function
supports4ByteText
()
{
return
$this
->
connection
->
supports4ByteText
();
}
}
This diff is collapsed.
Click to expand it.
tests/lib/Files/PathVerificationTest.php
+
8
−
2
View file @
7998689b
...
...
@@ -9,6 +9,7 @@ namespace Test\Files;
use
OC\Files\Storage\Local
;
use
OC\Files\View
;
use
OCP\Files\InvalidPathException
;
/**
* Class PathVerificationTest
...
...
@@ -79,10 +80,15 @@ class PathVerificationTest extends \Test\TestCase {
/**
* @dataProvider providesAstralPlane
* @expectedException \OCP\Files\InvalidPathException
* @expectedExceptionMessage 4-byte characters are not supported in file names
*/
public
function
testPathVerificationAstralPlane
(
$fileName
)
{
$connection
=
\OC
::
$server
->
getDatabaseConnection
();
if
(
!
$connection
->
supports4ByteText
())
{
$this
->
expectException
(
InvalidPathException
::
class
);
$this
->
expectExceptionMessage
(
'4-byte characters are not supported in file names'
);
}
$this
->
view
->
verifyPath
(
''
,
$fileName
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment