Skip to content

Commit 8e59d49

Browse files
Merge pull request nextcloud#32435 from nextcloud/revert-32278-remove-default-php
Revert "Remove call to already default php.ini values"
2 parents 2dea9a1 + a6ca9d5 commit 8e59d49

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lib/base.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class OC {
143143
public static function initPaths() {
144144
if (defined('PHPUNIT_CONFIG_DIR')) {
145145
self::$configDir = OC::$SERVERROOT . '/' . PHPUNIT_CONFIG_DIR . '/';
146-
} elseif (defined('PHPUNIT_RUN') && PHPUNIT_RUN && is_dir(OC::$SERVERROOT . '/tests/config/')) {
146+
} elseif (defined('PHPUNIT_RUN') and PHPUNIT_RUN and is_dir(OC::$SERVERROOT . '/tests/config/')) {
147147
self::$configDir = OC::$SERVERROOT . '/tests/config/';
148148
} elseif ($dir = getenv('NEXTCLOUD_CONFIG_DIR')) {
149149
self::$configDir = rtrim($dir, '/') . '/';
@@ -464,6 +464,14 @@ private static function getSessionLifeTime() {
464464
return \OC::$server->getConfig()->getSystemValue('session_lifetime', 60 * 60 * 24);
465465
}
466466

467+
/**
468+
* Try to set some values to the required Nextcloud default
469+
*/
470+
public static function setRequiredIniValues() {
471+
@ini_set('default_charset', 'UTF-8');
472+
@ini_set('gd.jpeg_ignore_warning', '1');
473+
}
474+
467475
/**
468476
* Send the same site cookies
469477
*/
@@ -630,6 +638,7 @@ public static function init() {
630638
@set_time_limit(max(intval(@ini_get('max_execution_time')), intval(@ini_get('max_input_time'))));
631639
}
632640

641+
self::setRequiredIniValues();
633642
self::handleAuthHeaders();
634643
$systemConfig = \OC::$server->get(\OC\SystemConfig::class);
635644
self::registerAutoloaderCache($systemConfig);

0 commit comments

Comments
 (0)