mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-12-02 13:32:43 -05:00
Currently, SimplePie uses legacy DOMDocument parsing, which outputs potentially problematic HTML, not correctly sanitised.
This breaks the assumption that one can use something like `<div><!-- some HTML sanitized from SimplePie --></div>`.
```
--- Expected
+++ Actual
@@ @@
'<ul>
- <li><div></div></li>
+ <li><div>
<li>Item</li>
-</ul>'
+</div></li></ul>'
```
When shown in a compliant Web browser, several tags will be wrongly closed, breaking the layout of the client.
This PR patches SimplePie to use the modern parser and code syntax, while maintaining a best-effort polyfill for legacy PHP versions < 8.4.
Depends on:
SimplePie: Upgrade to PHPStan 2
* https://github.com/FreshRSS/simplepie/pull/97
* https://github.com/simplepie/simplepie/pull/939
* https://github.com/simplepie/simplepie/pull/1019
SimplePie: Use PHP 8.4+ \Dom classes and functions
* https://github.com/FreshRSS/simplepie/pull/98
* https://github.com/simplepie/simplepie/issues/1021
SimplePie: Add unit test for HTML5 sanitizing compliance
* https://github.com/simplepie/simplepie/pull/1022
SimplePie: Remove obsolete xml_is_sane and XMLReader fallback
* https://github.com/simplepie/simplepie/pull/1023
CssXPath: Add support for case insensitivity
* https://github.com/phpgt/CssXPath/pull/256
fix https://github.com/FreshRSS/FreshRSS/issues/5201
fix https://github.com/FreshRSS/FreshRSS/issues/6830
fix https://github.com/FreshRSS/FreshRSS/issues/6831
~5% faster for HTML sanitising.
Remove SimpleXML. Remove XMLReader.
39 lines
1.4 KiB
Docker
39 lines
1.4 KiB
Docker
FROM alpine:3.24
|
|
|
|
ENV TZ=UTC
|
|
SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
|
|
|
|
RUN apk add --no-cache \
|
|
tzdata \
|
|
apache2 php-apache2 \
|
|
php php-curl php-gmp php-intl php-mbstring php-xml php-zip \
|
|
php-ctype php-dom php-fileinfo php-iconv php-json php-opcache php-openssl php-phar php-session php-simplexml php-xmlwriter php-xml php-tokenizer php-zlib \
|
|
php-pdo_sqlite php-pdo_mysql php-pdo_pgsql \
|
|
bash composer curl docker-cli-buildx git gpg make nodejs npm shellcheck shfmt sudo
|
|
|
|
RUN \
|
|
# Disable unwanted Apache modules and configurations
|
|
rm -f /etc/apache2/conf.d/languages.conf /etc/apache2/conf.d/info.conf \
|
|
/etc/apache2/conf.d/status.conf /etc/apache2/conf.d/userdir.conf && \
|
|
sed -r -i "/^\s*LoadModule .*mod_(alias|autoindex|negotiation|status).so$/s/^/#/" \
|
|
/etc/apache2/httpd.conf && \
|
|
sed -r -i "/^\s*(CustomLog|ErrorLog|Listen) /s/^/#/" \
|
|
/etc/apache2/httpd.conf && \
|
|
# Enable required Apache modules
|
|
sed -r -i "/^\s*#\s*LoadModule .*mod_(deflate|expires|filter|headers|mime|remoteip|setenvif).so$/s/^\s*#//" \
|
|
/etc/apache2/httpd.conf
|
|
|
|
RUN adduser --ingroup www-data --disabled-password developer && \
|
|
echo "developer ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/developer
|
|
|
|
ENV COPY_LOG_TO_SYSLOG=On
|
|
ENV COPY_SYSLOG_TO_STDERR=On
|
|
ENV CRON_MIN=''
|
|
ENV DATA_PATH=''
|
|
ENV ENABLE_ACCESS_LOG=1
|
|
ENV FRESHRSS_ENV='development'
|
|
ENV LISTEN='0.0.0.0:8080'
|
|
ENV TRUSTED_PROXY=0
|
|
|
|
EXPOSE 8080
|