summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/base.php2
-rw-r--r--lib/private/Files/Filesystem.php2
-rw-r--r--lib/private/L10N/Factory.php65
-rw-r--r--lib/private/legacy/OC_Util.php2
-rw-r--r--lib/private/legacy/template/functions.php3
-rw-r--r--lib/public/L10N/IFactory.php9
6 files changed, 5 insertions, 78 deletions
diff --git a/lib/base.php b/lib/base.php
index 6578d506796..3c10f7cb33a 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -775,7 +775,7 @@ class OC {
if (!$isScssRequest) {
http_response_code(400);
- \OC::$server->getLogger()->info(
+ \OC::$server->getLogger()->warning(
'Trusted domain error. "{remoteAddress}" tried to access using "{host}" as host.',
[
'app' => 'core',
diff --git a/lib/private/Files/Filesystem.php b/lib/private/Files/Filesystem.php
index a9b1b87c8e7..fb300134c86 100644
--- a/lib/private/Files/Filesystem.php
+++ b/lib/private/Files/Filesystem.php
@@ -835,7 +835,7 @@ class Filesystem {
* @param string $path
* @param boolean $includeMountPoints whether to add mountpoint sizes,
* defaults to true
- * @return \OC\Files\FileInfo|bool False if file does not exist
+ * @return \OC\Files\FileInfo|false False if file does not exist
*/
public static function getFileInfo($path, $includeMountPoints = true) {
return self::$defaultInstance->getFileInfo($path, $includeMountPoints);
diff --git a/lib/private/L10N/Factory.php b/lib/private/L10N/Factory.php
index 426ddf6c380..7fcfab37fa6 100644
--- a/lib/private/L10N/Factory.php
+++ b/lib/private/L10N/Factory.php
@@ -595,71 +595,6 @@ class Factory implements IFactory {
return $this->serverRoot . '/core/l10n/';
}
-
- /**
- * Creates a function from the plural string
- *
- * Parts of the code is copied from Habari:
- * https://github.com/habari/system/blob/master/classes/locale.php
- * @param string $string
- * @return string
- */
- public function createPluralFunction($string) {
- if (isset($this->pluralFunctions[$string])) {
- return $this->pluralFunctions[$string];
- }
-
- if (preg_match('/^\s*nplurals\s*=\s*(\d+)\s*;\s*plural=(.*)$/u', $string, $matches)) {
- // sanitize
- $nplurals = preg_replace('/[^0-9]/', '', $matches[1]);
- $plural = preg_replace('#[^n0-9:\(\)\?\|\&=!<>+*/\%-]#', '', $matches[2]);
-
- $body = str_replace(
- ['plural', 'n', '$n$plurals',],
- ['$plural', '$n', '$nplurals',],
- 'nplurals=' . $nplurals . '; plural=' . $plural
- );
-
- // add parents
- // important since PHP's ternary evaluates from left to right
- $body .= ';';
- $res = '';
- $p = 0;
- $length = strlen($body);
- for ($i = 0; $i < $length; $i++) {
- $ch = $body[$i];
- switch ($ch) {
- case '?':
- $res .= ' ? (';
- $p++;
- break;
- case ':':
- $res .= ') : (';
- break;
- case ';':
- $res .= str_repeat(')', $p) . ';';
- $p = 0;
- break;
- default:
- $res .= $ch;
- }
- }
-
- $body = $res . 'return ($plural>=$nplurals?$nplurals-1:$plural);';
- $function = create_function('$n', $body);
- $this->pluralFunctions[$string] = $function;
- return $function;
- } else {
- // default: one plural form for all cases but n==1 (english)
- $function = create_function(
- '$n',
- '$nplurals=2;$plural=($n==1?0:1);return ($plural>=$nplurals?$nplurals-1:$plural);'
- );
- $this->pluralFunctions[$string] = $function;
- return $function;
- }
- }
-
/**
* @inheritDoc
*/
diff --git a/lib/private/legacy/OC_Util.php b/lib/private/legacy/OC_Util.php
index d9657dd4174..abe7e59f695 100644
--- a/lib/private/legacy/OC_Util.php
+++ b/lib/private/legacy/OC_Util.php
@@ -580,7 +580,7 @@ class OC_Util {
/**
* add a javascript file
*
- * @deprecated 24.0.0
+ * @deprecated 24.0.0 - Use \OCP\Util::addScript
*
* @param string $application application id
* @param string|null $file filename
diff --git a/lib/private/legacy/template/functions.php b/lib/private/legacy/template/functions.php
index e28cf02f7a3..56c488d5abe 100644
--- a/lib/private/legacy/template/functions.php
+++ b/lib/private/legacy/template/functions.php
@@ -118,10 +118,11 @@ function print_unescaped($string) {
* they are coming from a template registration.
* Please consider moving them into the relevant controller
*
+ * @deprecated 24.0.0 - Use \OCP\Util::addScript
+ *
* @param string $app the appname
* @param string|string[] $file the filename,
* if an array is given it will add all scripts
- * @deprecated 23.1.0
*/
function script($app, $file = null) {
if (is_array($file)) {
diff --git a/lib/public/L10N/IFactory.php b/lib/public/L10N/IFactory.php
index 0c8c945caab..35713862f07 100644
--- a/lib/public/L10N/IFactory.php
+++ b/lib/public/L10N/IFactory.php
@@ -128,15 +128,6 @@ interface IFactory {
public function localeExists($locale);
/**
- * Creates a function from the plural string
- *
- * @param string $string
- * @return string Unique function name
- * @since 14.0.0
- */
- public function createPluralFunction($string);
-
- /**
* iterate through language settings (if provided) in this order:
* 1. returns the forced language or:
* 2. if applicable, the trunk of 1 (e.g. "fu" instead of "fu_BAR"