Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sanitizers for JSON output #24663

Merged
merged 1 commit into from
Dec 14, 2020
Merged

Add sanitizers for JSON output #24663

merged 1 commit into from
Dec 14, 2020

Conversation

LukasReschke
Copy link
Member

Those functions set proper content-types that prevent rendering of data. Therefore it's safe to mark them as sanitizers.

Those functions set proper content-types that prevent rendering of
data. Therefore it's safe to mark them as sanitizers.

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
@faily-bot
Copy link

faily-bot bot commented Dec 11, 2020

🤖 beep boop beep 🤖

Here are the logs for the failed build:

Status of 403: failure

mysql8.0-php7.4

Show full log
There were 3 errors:

1) OCA\Files\Tests\BackgroundJob\DeleteOrphanedItemsJobTest::testClearUserTagMappings
Doctrine\DBAL\Exception\UniqueConstraintViolationException: An exception occurred while executing 'INSERT INTO `oc_filecache` (`storage`, `path`, `path_hash`) VALUES(?, ?, ?)' with params [1337, "apps\/files\/tests\/deleteorphanedtagsjobtest.php", "4cc42159b8d10b8a7295624bae65759f"]:

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1337-4cc42159b8d10b8a7295624bae65759f' for key 'oc_filecache.fs_storage_path_hash'

/drone/src/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:74
/drone/src/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:182
/drone/src/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:159
/drone/src/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:2121
/drone/src/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:1463
/drone/src/lib/private/DB/Connection.php:247
/drone/src/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php:213
/drone/src/lib/private/DB/QueryBuilder/QueryBuilder.php:226
/drone/src/apps/files/tests/BackgroundJob/DeleteOrphanedItemsJobTest.php:124

Caused by
Doctrine\DBAL\Driver\PDO\Exception: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1337-4cc42159b8d10b8a7295624bae65759f' for key 'oc_filecache.fs_storage_path_hash'

/drone/src/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:18
/drone/src/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:117
/drone/src/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:1452
/drone/src/lib/private/DB/Connection.php:247
/drone/src/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php:213
/drone/src/lib/private/DB/QueryBuilder/QueryBuilder.php:226
/drone/src/apps/files/tests/BackgroundJob/DeleteOrphanedItemsJobTest.php:124

Caused by
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1337-4cc42159b8d10b8a7295624bae65759f' for key 'oc_filecache.fs_storage_path_hash'

/drone/src/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:115
/drone/src/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:1452
/drone/src/lib/private/DB/Connection.php:247
/drone/src/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php:213
/drone/src/lib/private/DB/QueryBuilder/QueryBuilder.php:226
/drone/src/apps/files/tests/BackgroundJob/DeleteOrphanedItemsJobTest.php:124

2) OCA\Files\Tests\BackgroundJob\DeleteOrphanedItemsJobTest::testClearComments
Doctrine\DBAL\Exception\UniqueConstraintViolationException: An exception occurred while executing 'INSERT INTO `oc_filecache` (`storage`, `path`, `path_hash`) VALUES(?, ?, ?)' with params [1337, "apps\/files\/tests\/deleteorphanedtagsjobtest.php", "4cc42159b8d10b8a7295624bae65759f"]:

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1337-4cc42159b8d10b8a7295624bae65759f' for key 'oc_filecache.fs_storage_path_hash'

/drone/src/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:74
/drone/src/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:182
/drone/src/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:159
/drone/src/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:2121
/drone/src/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:1463
/drone/src/lib/private/DB/Connection.php:247
/drone/src/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php:213
/drone/src/lib/private/DB/QueryBuilder/QueryBuilder.php:226
/drone/src/apps/files/tests/BackgroundJob/DeleteOrphanedItemsJobTest.php:173

Caused by
Doctrine\DBAL\Driver\PDO\Exception: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1337-4cc42159b8d10b8a7295624bae65759f' for key 'oc_filecache.fs_storage_path_hash'

/drone/src/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:18
/drone/src/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:117
/drone/src/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:1452
/drone/src/lib/private/DB/Connection.php:247
/drone/src/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php:213
/drone/src/lib/private/DB/QueryBuilder/QueryBuilder.php:226
/drone/src/apps/files/tests/BackgroundJob/DeleteOrphanedItemsJobTest.php:173

Caused by
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1337-4cc42159b8d10b8a7295624bae65759f' for key 'oc_filecache.fs_storage_path_hash'

/drone/src/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:115
/drone/src/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:1452
/drone/src/lib/private/DB/Connection.php:247
/drone/src/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php:213
/drone/src/lib/private/DB/QueryBuilder/QueryBuilder.php:226
/drone/src/apps/files/tests/BackgroundJob/DeleteOrphanedItemsJobTest.php:173

3) OCA\Files\Tests\BackgroundJob\DeleteOrphanedItemsJobTest::testClearCommentReadMarks
Doctrine\DBAL\Exception\UniqueConstraintViolationException: An exception occurred while executing 'INSERT INTO `oc_filecache` (`storage`, `path`, `path_hash`) VALUES(?, ?, ?)' with params [1337, "apps\/files\/tests\/deleteorphanedtagsjobtest.php", "4cc42159b8d10b8a7295624bae65759f"]:

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1337-4cc42159b8d10b8a7295624bae65759f' for key 'oc_filecache.fs_storage_path_hash'

/drone/src/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:74
/drone/src/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:182
/drone/src/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:159
/drone/src/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:2121
/drone/src/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:1463
/drone/src/lib/private/DB/Connection.php:247
/drone/src/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php:213
/drone/src/lib/private/DB/QueryBuilder/QueryBuilder.php:226
/drone/src/apps/files/tests/BackgroundJob/DeleteOrphanedItemsJobTest.php:224

Caused by
Doctrine\DBAL\Driver\PDO\Exception: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1337-4cc42159b8d10b8a7295624bae65759f' for key 'oc_filecache.fs_storage_path_hash'

/drone/src/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:18
/drone/src/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:117
/drone/src/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:1452
/drone/src/lib/private/DB/Connection.php:247
/drone/src/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php:213
/drone/src/lib/private/DB/QueryBuilder/QueryBuilder.php:226
/drone/src/apps/files/tests/BackgroundJob/DeleteOrphanedItemsJobTest.php:224

Caused by
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1337-4cc42159b8d10b8a7295624bae65759f' for key 'oc_filecache.fs_storage_path_hash'

/drone/src/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:115
/drone/src/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:1452
/drone/src/lib/private/DB/Connection.php:247
/drone/src/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php:213
/drone/src/lib/private/DB/QueryBuilder/QueryBuilder.php:226
/drone/src/apps/files/tests/BackgroundJob/DeleteOrphanedItemsJobTest.php:224

--

There were 2 warnings:

1) Test\Files\ViewTest::testRenameFailDeleteTargetKeepSource
Trying to configure method "writeStream" which cannot be configured because it does not exist, has not been specified, is final, or is static

2) Test\Files\ViewTest::testCopyFailDeleteTargetKeepSource
Trying to configure method "writeStream" which cannot be configured because it does not exist, has not been specified, is final, or is static

--

There was 1 failure:

1) OCA\Files\Tests\BackgroundJob\DeleteOrphanedItemsJobTest::testClearSystemTagMappings
Failed asserting that actual size 0 matches expected size 1.

/drone/src/apps/files/tests/BackgroundJob/DeleteOrphanedItemsJobTest.php:103

@rullzer rullzer merged commit b2ef004 into master Dec 14, 2020
@rullzer rullzer deleted the sanitizers branch December 14, 2020 08:11
@rullzer rullzer added this to the Nextcloud 21 milestone Dec 14, 2020
@rullzer rullzer mentioned this pull request Dec 14, 2020
59 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants