Commit Graph

135 Commits

Author SHA1 Message Date
Roeland Jago Douma e01a488b31 Remove generateRandomBytes from OC_Util 2016-01-10 22:07:33 +01:00
Morris Jobke 6f00729124 Refactor OC_Util::callCheck 2015-12-22 09:32:14 +01:00
Morris Jobke 450e2f3bd3 Move OC_Helper code to OCP\Util for linkToRemote 2015-12-18 12:00:18 +01:00
Morris Jobke e42f262d85 properly use OCP\Util instead of OC_Helper 2015-12-18 11:46:21 +01:00
Roeland Jago Douma 9fe3d2f1f8 OC_Helper::linkToRoute is deprecated
Replaced all calls to OC_Helper::linkToRoute with
OC::$server->getURLGenerator()->linkToRoute
2015-12-17 18:46:42 +01:00
Roeland Jago Douma 19eeb23b91 OC_Helper::linkTo is deprecated
Replaced with suggested (and calling body of)
2015-12-17 10:53:21 +01:00
Lukas Reschke 4b293dffe5 Use \OCP\Util::sanitizeHTML instead of \OC_Util::sanitizeHTML 2015-12-08 08:56:47 +01:00
Morris Jobke baecfc4080 Reduce OC_Config usage in lib/
* replaced by proper public interfaces
2015-12-02 14:49:40 +01:00
Morris Jobke 4fcab98694 Remove unused internal methods
* removes OC_Helper::mb_substr_replace and OC_Helper::mb_str_replace
* keeps public interface wrapper working as expected
2015-11-26 10:25:43 +01:00
Thomas Müller 9ec2850c78 Use mocks when testing isSharingDisabledForUser 2015-11-19 15:36:16 +01:00
Morris Jobke b945d71384 update licence headers via script 2015-10-05 21:15:52 +02:00
Individual IT Services fbe43e6a26 cache result of \OCP\Util::needUpgrade()
reduce calls of \OCP\Util::needUpgrade()
where \OCP\Util::needUpgrade() is called we can call as well
self::checkUpgrade and use the cached result
In line 877 the call way unnecessary anyway because of the first part of
the if statement

move caching to \OCP\Util::needUpgrade

renaming variable

fixing testNeedUpgradeCore()

cache result of checkUpgrade() in self::$needUpgrade

reduce calls of \OCP\Util::needUpgrade()
where \OCP\Util::needUpgrade() is called we can call as well
self::checkUpgrade and use the cached result
In line 877 the call way unnecessary anyway because of the first part of
the if statement

move caching to \OCP\Util::needUpgrade

renaming variable

fixing testNeedUpgradeCore()

fix typo in variable name

deleting tabs
2015-09-29 15:34:42 +02:00
Morris Jobke db8e7ce8b9 Remove passwords from logged exception stack traces
* fixed #16318
* create logException in ILogger
* add unit tests
2015-09-24 20:01:30 +02:00
blizzz bfb90d10ed Merge pull request #17046 from nicolas-grekas/fix-16654
Do not use OC*::mb_*_replace(), they are useless
2015-07-16 11:35:25 +02:00
Nicolas Grekas 472d48f6e3 Do not use OC*::mb_*_replace(), they are useless 2015-07-16 11:00:04 +02:00
Thomas Müller 403deb2a33 Fixing unit test execution 2015-07-03 18:00:16 +02:00
Thomas Müller d3ac73c0c9 Remove OC_Log 2015-07-03 18:00:16 +02:00
Morris Jobke 0c9604e3b2 [OCP] update PHPdoc to contain correct @since tags 2015-06-05 17:30:45 +02:00
Victor Dubiniuk af814ba270 Allow change update channel via public API 2015-05-13 20:29:33 +03:00
Roeland Douma d877c1f1e1 Merge pull request #15736 from owncloud/remove-dependency-on-legacy-code-in-ocp
Reduce call of legacy wrapper by call the OCP directly
2015-04-19 15:42:07 +02:00
Morris Jobke c056c52010 Add version to @deprecated tags 2015-04-19 01:04:59 +02:00
Morris Jobke 9b8ebdadf7 Reduce call of legacy wrapper by call the OCP directly
* ref #15734
* reduces the call depth, because the private methods just call OCP stuff
2015-04-19 00:29:09 +02:00
Thomas Müller d671f13f26 Write the type of exception to the log - really helpful for exceptions which hold no message 2015-04-17 13:10:10 +02:00
Morris Jobke 7644950b48 Add @since tags to all methods in public namespace
* enhance the app development experience - you can look up the
  method introduction right inside the code without searching
  via git blame
* easier to write apps for multiple versions
2015-04-16 17:00:08 +02:00
Thomas Müller 111fbabfb4 PHPDoc cleanup - clean code \o/ 2015-04-07 13:30:31 +02:00
Thomas Müller bf809ac85a Removing left overs from old encryption app 2015-04-07 13:30:29 +02:00
Roeland Jago Douma 288da619b1 Deprecate functions that only call the urlgenerator anyway 2015-04-01 14:32:49 +02:00
Jenkins for ownCloud b585d87d9d Update license headers 2015-03-26 11:44:36 +01:00
Lukas Reschke 7a70fffa6c Don't fallback to Plaintext per default for legacy class 2015-03-16 14:10:03 +01:00
Lukas Reschke f92f3a1a6e Incorporate review changes 2015-03-16 12:47:05 +01:00
Lukas Reschke 13486a5ada Migrate to SwiftMail
Replaces the OC_Mail and phpmailer with SwiftMail allowing us to mock it properly.

Fixes the unit test execution on master on local machines and https://github.com/owncloud/core/issues/12014

Conflicts:
	3rdparty
	lib/private/server.php
	lib/public/iservercontainer.php
	tests/lib/mail.php
	tests/settings/controller/mailsettingscontrollertest.php

Conflicts:
	3rdparty
	lib/private/mail.php
	lib/private/server.php
	lib/public/iservercontainer.php
	settings/ajax/lostpassword.php
	settings/application.php
2015-03-16 12:47:05 +01:00
Thomas Müller e28d314b53 deprecate isValidFileName() 2015-03-09 10:38:38 +01:00
Morris Jobke 06aef4e8b1 Revert "Updating license headers"
This reverts commit 6a1a4880f0.
2015-02-26 11:37:37 +01:00
Jenkins for ownCloud 6a1a4880f0 Updating license headers 2015-02-23 12:13:59 +01:00
Lukas Reschke 886bda5f81 Refactor OC_Request into TrustedDomainHelper and IRequest
This changeset removes the static class `OC_Request` and moves the functions either into `IRequest` which is accessible via `\OC::$server::->getRequest()` or into a separated `TrustedDomainHelper` class for some helper methods which should not be publicly exposed.

This changes only internal methods and nothing on the public API. Some public functions in `util.php` have been deprecated though in favour of the new non-static functions.

Unfortunately some part of this code uses things like `__DIR__` and thus is not completely unit-testable. Where tests where possible they ahve been added though.

Fixes https://github.com/owncloud/core/issues/13976 which was requested in https://github.com/owncloud/core/pull/13973#issuecomment-73492969
2015-02-16 22:13:00 +01:00
Joas Schilling 4d232e536e Deprecate Util::formatDate()
Make DateTimeFormatter a service and adjust tests that have been inaccurate
2014-12-10 11:58:56 +01:00
Joas Schilling 2c39aec8cb Replace deprecated constant with new class constant 2014-11-25 16:30:21 +01:00
Vincent Petry bed81ea854 Merge pull request #11080 from owncloud/addheader-text-2
Fix the addHeader tag attributes text methods to not ignore the text parameter
2014-10-30 18:13:46 +01:00
Vincent Petry ec1a73fab9 Added OC.L10N namespace with translation functions
Added addTranslations and fixed de.js file

Fixed de.js to use OC.L10N.register() and use to correct expected
format.

Added JS unit tests for OC.L10N class

Include translations JS script for all apps
2014-10-29 10:09:12 +01:00
Lukas Reschke 510d0b2cf3 Fix the "addHeader($tag, $attributes, $text)" methods to not ignore the $text parameter
Also support closing tags with no text content given

Conflicts:
	lib/private/template.php
2014-10-28 11:15:58 +01:00
Vincent Petry 9fc23e1967 Merge pull request #10934 from owncloud/datadir-write-setup
Don't complain about non-writable datadirs before we're installed
2014-09-25 14:32:32 +02:00
Lukas Reschke 75e45ac786 Merge pull request #11019 from owncloud/do-not-show-exception-to-enduser
Do not show exception to the end-user - use a proper error page instead
2014-09-23 18:36:40 +02:00
Thomas Müller 814114ab8e enhance formatDate function to accept an optional argument containing the time zone 2014-09-22 15:03:28 +02:00
Robin Appelman 6fa3280c2a Inject config into checkserver and cleanup tests 2014-09-18 13:33:13 +02:00
Lukas Reschke 6d3757f864 Do not show exception to the end-user
Log the error instead of potentially leaking sensitive information
2014-09-17 13:17:52 +02:00
Lukas Reschke d2743e6ad6 Merge pull request #7254 from owncloud/core-sortalgo
Fixed JS sort comparator to be consistent between JS and PHP
2014-09-16 17:29:03 +02:00
Lukas Reschke ae3425d2da Merge branch 'master' into securityutils
Conflicts:
	lib/private/util.php
2014-08-31 15:21:09 +02:00
Robin Appelman d0266c0bf8 Use public api for getting l10n 2014-08-31 10:08:22 +02:00
Lukas Reschke d26a9c3c58 Add some security utilities
This adds some security utilities to core including:
- A library for basic crypto operations (e.g. to encrypt passwords)
- A better library for cryptographic actions which allows you to specify the charset
- A library for secure string comparisions

Remove .htaccess

Remove .htaccess

Fix typo

Add public API

Use timing constant comparision

Remove CBC constant

Adjust code

Remove confusing $this
2014-08-27 00:18:04 +02:00
Vincent Petry 173059f6d0 Fixed file list sorting
Now using a natural sort algorithm that is more consistent between JS
and PHP (although not perfect in some corner cases)

- added OC.Util.naturalSortComparator that uses the same algo that was
  used for the user list
- changed user list and files list to use OC.Util.naturalSortComparator
- removed toLowerCase() and changed the comparator to use
  String.localeCompare()
- added unit tests
- added OC_NaturalSort that is used by OCP\Util::naturalSortCompare()
2014-08-11 13:28:53 +02:00