[wp-trac] [WordPress Trac] #45644: Warning: preg_match(): Compilation failed in class-wp-block-parser.php line 382

WordPress Trac noreply at wordpress.org
Mon Jan 7 00:21:39 UTC 2019


#45644: Warning: preg_match(): Compilation failed in class-wp-block-parser.php line
382
--------------------------+---------------------
 Reporter:  ledavdotnet   |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  5.1
Component:  Editor        |     Version:  5.0.1
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+---------------------

Comment (by ledavdotnet):

 Hi @desroj,

 Replying to [comment:7 desrosj]:
 > Thanks for opening this ticket!

 And thanks for your reply :-)

 > First, I do highly recommend that you upgrade to a more recent version
 of PHP. 5.3 has not been supported since 2014 (over 4 years).

 Yeah I know, shame on me... This is an old CentOS 5 that I'm going to
 replace soon as possible... It will take some time though...

 > I am trying to reproduce the issue but have been unable to so far. I am
 running PHP v5.3.29, and PCRE v8.32.

 As I reported above, mine is even older: php 5.3.3 and pcre 6.6 ...
 Probably your version don't suffer of this problem.

 > Can you be more specific about when and how you are able to cause the
 issue? For example, does it happen when a specific type of block is in a
 post? Does it happen with an empty post? Specific steps will help someone
 else reproduce the problem you are seeing.

 I reverted the patch and did few more checks and the problem appears on
 all the pages and in all the posts, always right after the '''<div
 class="entry">''' tag. There is no problem however in the administration
 interface.

 Example:
 {{{
 <div class="post-1864 post type-post status-publish format-standard hentry
 category-blabla" id="post-1864">
                         <h2>title</h2>
                         <small>Thursday, May 3rd, 2012</small>
                         <div class="entry">

 Warning: preg_match(): Compilation failed: unrecognized character after
 (?< at
 offset 10 in /wordpress/wp-includes/class-wp-block-parser.php on line 382
 <blockquote><p>Some text....
 }}}

 However, something maybe more interesting: The same error could be
 reproduced using the ''pcregrep'' command line tool:

 pcregrep version 4.2 09-Jan-2006 using PCRE version 6.6 06-Feb-2006:
 {{{#!bash
 $ echo "" | pcregrep '/<!--\s+(?<closer>\/)?/s' && echo TRUE || echo FALSE
 pcregrep: Error in command-line regex at offset 11: unrecognized character
 after (?<
 FALSE
 }}}

 pcregrep version 8.42 2018-03-20:
 {{{#!bash
 $ echo "" | pcregrep '/<!--\s+(?<closer>\/)?/s' && echo TRUE || echo FALSE
 FALSE
 }}}

 Note also that I just updated wordpress to v5.0.2: Same problem, same
 patch to fix the issue...

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/45644#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list