Skip to content

Commit 0e66b93

Browse files
authored
IBX-7818: Fixed direct access to index.php with long URL (#34)
* IBX-7818: Fixed direct acces to index.php with long URL * imagick workaround * redis 6.0.2 * fixup! imagick workaround
1 parent 805eb8c commit 0e66b93

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

php/Dockerfile-7.3

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ RUN set -xe \
8888
&& docker-php-ext-enable igbinary \
8989
\
9090
# Install redis (manualy build in order to be able to enable igbinary)
91-
&& for i in $(seq 1 3); do pecl install -o --nobuild redis && s=0 && break || s=$? && sleep 1; done; (exit $s) \
91+
&& for i in $(seq 1 3); do pecl install -o --nobuild "redis-6.0.2" && s=0 && break || s=$? && sleep 1; done; (exit $s) \
9292
&& cd "$(pecl config-get temp_dir)/redis" \
9393
&& phpize \
9494
&& ./configure --enable-redis-igbinary \

php/Dockerfile-8.3

+12-3
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,18 @@ RUN set -xe \
7979
&& docker-php-ext-enable opcache \
8080
&& cp /usr/src/php/php.ini-production ${PHP_INI_DIR}/php.ini \
8181
\
82-
# Install imagemagick
83-
&& for i in $(seq 1 3); do pecl install -o imagick && s=0 && break || s=$? && sleep 1; done; (exit $s) \
84-
&& docker-php-ext-enable imagick \
82+
# Imagick is installed from the archive because regular installation fails
83+
# See: https://github.com/Imagick/imagick/issues/643#issuecomment-1834361716
84+
&& curl -L -o /tmp/imagick.tar.gz https://github.com/Imagick/imagick/archive/refs/tags/3.7.0.tar.gz \
85+
&& tar --strip-components=1 -xf /tmp/imagick.tar.gz \
86+
&& phpize \
87+
&& ./configure \
88+
&& make \
89+
&& make install \
90+
&& echo "extension=imagick.so" > /usr/local/etc/php/conf.d/ext-imagick.ini \
91+
&& rm -rf /tmp/* \
92+
# <<< End of Imagick installation
93+
8594
# Install xdebug
8695
&& for i in $(seq 1 3); do echo yes | pecl install -o "xdebug" && s=0 && break || s=$? && sleep 1; done; (exit $s) \
8796
# Install blackfire: https://blackfire.io/docs/integrations/docker

templates/apache2/vhost.template

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
RewriteRule ^/(css|js|fonts?)/.*\.(css|js|otf|eot|ttf|svg|woff) - [L]
101101

102102
# Prevent access to website with direct usage of index.php in URL
103-
RewriteRule ^/([^/]+/)?index\.php([/?#]|$) - [R=404,L]
103+
RewriteRule ^/([^/]+/)*?index\.php([/?#]|$) - [R=404,L]
104104

105105
RewriteRule .* /index.php
106106
</IfModule>

templates/nginx/ez_params.d/ez_rewrite_params

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ rewrite "^/build/(.*)" "/build/$1" break;
1919
rewrite "^/assets/(.*)" "/assets/$1" break;
2020

2121
# Prevent access to website with direct usage of index.php in URL
22-
if ($request_uri ~ "^/([^/]+/)?index\.php([/?#]|$)") {
22+
if ($request_uri ~ "^/([^/]+/)*?index\.php([/?#]|$)") {
2323
return 404;
2424
}
2525

0 commit comments

Comments
 (0)