Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation Error #400

Closed
AcaDemIQ opened this issue Jan 25, 2019 · 5 comments
Closed

Compilation Error #400

AcaDemIQ opened this issue Jan 25, 2019 · 5 comments
Labels
Milestone

Comments

@AcaDemIQ
Copy link

AcaDemIQ commented Jan 25, 2019

Description

I had compilation errors on each sites

Steps to reproduce

  1. Setup Docker image using offical php image
FROM php:7.3.1-apache-stretch
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y wget 
WORKDIR /var/www
RUN wget https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz
RUN tar xvf dokuwiki-stable.tgz
RUN mv ./dokuwiki-*/ ./dokuwiki
RUN chown -R www-data:www-data /var/www/dokuwiki
COPY ./000-default.conf /etc/apache2/sites-enabled
COPY ./apache2.conf /etc/apache2/apache2.conf
RUN service apache2 restart
EXPOSE 80
  1. Add your template to DokuWiki

  2. Get errors

Warning: preg_match_all(): Compilation failed: invalid range in character class at offset 4 in /var/www/dokuwiki/lib/tpl/bootstrap3/inc/simple_html_dom.php on line 758

Warning: Invalid argument supplied for foreach() in /var/www/dokuwiki/lib/tpl/bootstrap3/inc/simple_html_dom.php on line 765

Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /var/www/dokuwiki/lib/tpl/bootstrap3/inc/simple_html_dom.php on line 1438

Versions

  • [Bootstrap3 Template 2018-02-16]
  • [DokuWiki 2018-04-22b ]
  • [Plugins standarts]
@AcaDemIQ
Copy link
Author

I changed simple_html_dom.php from if (!preg_match("/^[\w-:]+$/", $tag)) to if (!preg_match("/^[\w]+$/", $tag)). Is it correct?

@Kyushin
Copy link

Kyushin commented Jan 28, 2019

I changed this :

1438 - if (!preg_match("/^[\w-:]+$/", $tag)) {
1438 + if (!preg_match("/^[\w\-:]+$/", $tag)) {

757 - $pattern = "/([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-:]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is";
757 + $pattern = "/([\w\-:\*]*)(?:\#([\w\-]+)|\.([\w\-]+))?(?:\[@?(!?[\w\-:]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is";

Using PHP 7.3.0 I have to escape -.

I hope this could help.

@dccafe
Copy link

dccafe commented Feb 8, 2019

Yep, that works for me. Can you write a patch and submit a pull request for us?

@giterlizzi
Copy link
Owner

giterlizzi commented Feb 22, 2019

Hi,
I have fixed this issue in develop branch using @Kyushin patch

Thanks!!!

@giterlizzi giterlizzi added this to the v2019-04 milestone Mar 12, 2019
@ihewro
Copy link

ihewro commented Apr 4, 2019

thank you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants