This question about Using an extension: Asked

Unescaped left brace in regex with new Perl versions

Using new Perl versions the ObjectPlugin not work because there are 2 Compilation errors related to "Unescaped left brace in regex" new restriction.

Please use this patch in files lib/Foswiki/Plugins/ObjectPlugin.pm and lib/Foswiki/Plugins/ObjectPlugin/ObjectSet.pm

# diff lib/Foswiki/Plugins/ObjectPlugin.pm lib/Foswiki/Plugins/ObjectPlugin.pm~
71c71
<     return unless ( $_[0] =~ m/%OBJECT\{.*\}%/o );
---
>     return unless ( $_[0] =~ m/%OBJECT{.*}%/o );
84c84
<    return unless $_[0] =~ m/%OBJECT\{.*?\}%/o;
---
>    return unless $_[0] =~ m/%OBJECT{.*?}%/o;
# diff lib/Foswiki/Plugins/ObjectPlugin/ObjectSet.pm lib/Foswiki/Plugins/ObjectPlugin/ObjectSet.pm~
62c62
<     my @blocks = split( /(%OBJECT\{.*?\}%|%ENDOBJECT%)/, $text );
---
>     my @blocks = split( /(%OBJECT{.*?}%|%ENDOBJECT%)/, $text );
66c66
<         if ($block =~ /^%OBJECT\{(.*)\}%$/) {
---
>         if ($block =~ /^%OBJECT{(.*)}%$/) {
173,174c173,174
<     my @blocks = split( /(%OBJECT\{.*?\}%|%ENDOBJECT%)/, $text, $limit );
<     if ($limit && $blocks[-1] =~ /%OBJECT\{.*?\}%/) { # more than $limit number of objects
---
>     my @blocks = split( /(%OBJECT{.*?}%|%ENDOBJECT%)/, $text, $limit );
>     if ($limit && $blocks[-1] =~ /%OBJECT{.*?}%/) { # more than $limit number of objects
179c179
<         if ($block =~ /^%OBJECT\{(.*)\}%$/) {
---
>         if ($block =~ /^%OBJECT{(.*)}%$/) {
335c335
<       Foswiki::Func::searchInWebContent( '%OBJECT\{.*\}%', $web,
---
>       Foswiki::Func::searchInWebContent( '%OBJECT{.*}%', $web,

-- GuidoBrugnara - 08 Jul 2019

 

QuestionForm edit

Subject Using an extension
Extension ObjectPlugin
Version Foswiki 2.1.6
Status Asked
Related Topics
Topic revision: r1 - 08 Jul 2019, GuidoBrugnara
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy