diff --git a/lib/private/files.php b/lib/private/files.php
index b0d070637d7afb8e7212889002f95673a5f802d6..9b6a1a4465f6a148414977bf97a8d733c6ab74fa 100644
--- a/lib/private/files.php
+++ b/lib/private/files.php
@@ -267,7 +267,7 @@ class OC_Files {
 				$pattern = vsprintf($patternMap['pattern'], [$key]);
 				$setting = vsprintf($patternMap['setting'], [$key, $size]);
 				$hasReplaced = 0;
-				$newContent = preg_replace($pattern, $setting, $content, 1, $hasReplaced);
+				$newContent = preg_replace($pattern, $setting, $content, 2, $hasReplaced);
 				if ($newContent !== null) {
 					$content = $newContent;
 				}