@@ -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