aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files/SimpleFS
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Files/SimpleFS')
-rw-r--r--lib/private/Files/SimpleFS/NewSimpleFile.php11
-rw-r--r--lib/private/Files/SimpleFS/SimpleFile.php7
2 files changed, 18 insertions, 0 deletions
diff --git a/lib/private/Files/SimpleFS/NewSimpleFile.php b/lib/private/Files/SimpleFS/NewSimpleFile.php
index f805403fd87..76fc69ebbe7 100644
--- a/lib/private/Files/SimpleFS/NewSimpleFile.php
+++ b/lib/private/Files/SimpleFS/NewSimpleFile.php
@@ -191,6 +191,17 @@ class NewSimpleFile implements ISimpleFile {
}
/**
+ * {@inheritDoc}
+ */
+ public function getExtension(): string {
+ if ($this->file) {
+ return $this->file->getExtension();
+ } else {
+ return \pathinfo($this->name, PATHINFO_EXTENSION);
+ }
+ }
+
+ /**
* Open the file as stream for reading, resulting resource can be operated as stream like the result from php's own fopen
*
* @return resource
diff --git a/lib/private/Files/SimpleFS/SimpleFile.php b/lib/private/Files/SimpleFS/SimpleFile.php
index baf9b24e020..21a2fd92dcb 100644
--- a/lib/private/Files/SimpleFS/SimpleFile.php
+++ b/lib/private/Files/SimpleFS/SimpleFile.php
@@ -159,6 +159,13 @@ class SimpleFile implements ISimpleFile {
}
/**
+ * {@inheritDoc}
+ */
+ public function getExtension(): string {
+ return $this->file->getExtension();
+ }
+
+ /**
* Open the file as stream for reading, resulting resource can be operated as stream like the result from php's own fopen
*
* @return resource