rahra / podlove-keywords

This Wordpress plugin inserts configurable keywords into Podlove Podcast Publisher's podcast feed.
2 stars 0 forks source link

preg_replace(): Compilation failed: invalid range in character class at offset 11 #1

Open MatthiasWiesner opened 2 years ago

MatthiasWiesner commented 2 years ago

The execution of preg_replace in

   /*! Check and sanitize value of input field.
   */
   public function check_keywords($val)
   {
      return preg_replace('/[^[:alnum:]-,]/i', '', $val);
   }

PodloveKeywordsPlugin::check_keywords fails with php7.4. With php7.3 the Perl-Compatible Regular Expressions (PCRE) extension has been upgraded to PCRE2. It's not documented if the :alnum: class is deprecated (at least I didn't find any)

This means that no more keywords are stored, but the workaround

return preg_replace('/[^[a-zA-Z0-9]-,]/i', '', $val);

solved the issue.

rahra commented 2 years ago

Thanks, I'll update it accordingly.