return $this->processor->getAllowedExtensions();
}
+ /**
+ * Returns a formatted list of the allowed file extensions.
+ *
+ * @return array<string>
+ */
+ public function getFormattedAllowedExtensions() {
+ $extensions = $this->getAllowedExtensions();
+
+ // sort
+ sort($extensions);
+
+ // check wildcards
+ for ($i = 0, $j = count($extensions); $i < $j; $i++) {
+ if (strpos($extensions[$i], '*') !== false) {
+ for ($k = $j - 1; $k > $i; $k--) {
+ if (preg_match('/^'.str_replace('\*', '.*', preg_quote($extensions[$i], '/')).'$/i', $extensions[$k])) {
+ array_splice($extensions, $k, 1);
+ $j--;
+ }
+ }
+ }
+ }
+
+ return $extensions;
+ }
+
/**
* @see wcf\system\attachment\IAttachmentObjectType::getMaxCount()
*/
<item name="wcf.attachment.upload.error.uploadFailed"><![CDATA[Beim Hochladen der Datei ist ein unbekannter Fehler aufgetreten.]]></item>
<item name="wcf.attachment.upload.limits"><![CDATA[Maximale Anzahl an Dateianhängen: {#$attachmentHandler->getMaxCount()}<br />
Maximale Dateigröße: {@$attachmentHandler->getMaxSize()|filesize}<br />
-Erlaubte Dateiendungen: {', '|implode:$attachmentHandler->getAllowedExtensions()}]]></item>
+Erlaubte Dateiendungen: {', '|implode:$attachmentHandler->getFormattedAllowedExtensions()}]]></item>
<item name="wcf.attachment.insert"><![CDATA[In Text einfügen]]></item>
<item name="wcf.attachment.delete.sure"><![CDATA[Wollen Sie den Dateianhang wirklich löschen?]]></item>
<item name="wcf.attachment.filename"><![CDATA[Dateiname]]></item>
<item name="wcf.attachment.upload.error.uploadFailed"><![CDATA[An unknown error occured during upload.]]></item>
<item name="wcf.attachment.upload.limits"><![CDATA[Maximum number of attachments: {#$attachmentHandler->getMaxCount()}<br />
Maximum file size: {@$attachmentHandler->getMaxSize()|filesize}<br />
-Allowed extensions: {', '|implode:$attachmentHandler->getAllowedExtensions()}]]></item>
+Allowed extensions: {', '|implode:$attachmentHandler->getFormattedAllowedExtensions()}]]></item>
<item name="wcf.attachment.insert"><![CDATA[Insert into message]]></item>
<item name="wcf.attachment.filename"><![CDATA[Filename]]></item>
<item name="wcf.attachment.uploadTime"><![CDATA[Upload Time]]></item>