diff --git a/modules/accesskeys.pl b/modules/accesskeys.pl index 293f0e9d..9d14cb5d 100644 --- a/modules/accesskeys.pl +++ b/modules/accesskeys.pl @@ -22,7 +22,7 @@ our (@MyRules, $FreeLinkPattern); push(@MyRules, \&LinksWithAccessKeys); sub LinksWithAccessKeys { - if (m/\G(\[\[$FreeLinkPattern\{(.)\}\]\])/cog) { + if (m/\G(\[\[$FreeLinkPattern\{(.)\}\]\])/cg) { my ($id, $key) = ($2, $3); Dirty($1); $id = FreeToNormal($id); diff --git a/modules/aggregate.pl b/modules/aggregate.pl index eb33e2c5..c9031951 100644 --- a/modules/aggregate.pl +++ b/modules/aggregate.pl @@ -26,7 +26,7 @@ our ($q, $bol, %Action, %Page, $OpenPageName, $UseDiff, $UsePathInfo, $RssStyleS push(@MyRules, \&AggregateRule); sub AggregateRule { - if ($bol && m/\G(<aggregate\s+((("[^\"&]+",?\s*)+)|(sort\s+)?search\s+(.+?))>)/gc) { + if ($bol && m/\G(<aggregate\s+((("[^\"&]+",?\s*)+)|(sort\s+)?search\s+(.+?))>)/cg) { Clean(CloseHtmlEnvironments()); Dirty($1); my ($oldpos, $old_, $str, $sort, $search) = ((pos), $_, $3, $5, $6); diff --git a/modules/agree-disagree.pl b/modules/agree-disagree.pl index 40865066..17c3ac9b 100644 --- a/modules/agree-disagree.pl +++ b/modules/agree-disagree.pl @@ -26,11 +26,11 @@ AddModuleDescription('agree-disagree.pl', 'AgreeDisagreePlugin'); push(@MyRules, \&AgreeDisagreeSupportRule); push(@MyMacros, sub{ s/\[\+\]/"[+:" . GetParam('username', T('Anonymous')) - . ':' . TimeToText($Now) . "]"/ge }); -push(@MyMacros, sub{ s/\[\+(:[^]:]+)\]/"[+$1:" . TimeToText($Now) . "]"/ge }); + . ':' . TimeToText($Now) . "]"/eg }); +push(@MyMacros, sub{ s/\[\+(:[^]:]+)\]/"[+$1:" . TimeToText($Now) . "]"/eg }); push(@MyMacros, sub{ s/\[\-\]/"[-:" . GetParam('username', T('Anonymous')) - . ':' . TimeToText($Now) . "]"/ge }); -push(@MyMacros, sub{ s/\[\-(:[^]:]+)\]/"[-$1:" . TimeToText($Now) . "]"/ge }); + . ':' . TimeToText($Now) . "]"/eg }); +push(@MyMacros, sub{ s/\[\-(:[^]:]+)\]/"[-$1:" . TimeToText($Now) . "]"/eg }); $DefaultStyleSheet .= <<'EOT' unless $DefaultStyleSheet =~ /div\.agree/; # mod_perl? @@ -78,17 +78,17 @@ EOT sub AgreeDisagreeSupportRule { if ($bol) { - if ($bol && m/(\G(\s*\[\+(.*?)\]|\s*\[-(.*?)\])+)/gcs) { + if ($bol && m/(\G(\s*\[\+(.*?)\]|\s*\[-(.*?)\])+)/cgs) { my $votes = $1; my @ayes = (); my @nayes = (); - while ($votes =~ m/\G.*?\[\+(.*?)\]/gcs) { + while ($votes =~ m/\G.*?\[\+(.*?)\]/cgs) { my ($ignore, $name, $time) = split(/:/, $1, 3); push(@ayes, $name); } my $votes2 = $votes; - while ($votes2 =~ m/\G.*?\[-(.*?)\]/gcs) { + while ($votes2 =~ m/\G.*?\[-(.*?)\]/cgs) { my ($ignore, $name, $time) = split(/:/, $1, 3); push(@nayes, $name); } diff --git a/modules/anchors.pl b/modules/anchors.pl index 3c23ae9d..a7625b66 100644 --- a/modules/anchors.pl +++ b/modules/anchors.pl @@ -21,13 +21,13 @@ our ($q, %Page, $FootnoteNumber, $FreeLinkPattern, @MyRules, $BracketWiki); push(@MyRules, \&AnchorsRule); sub AnchorsRule { - if (m/\G\[\[\#$FreeLinkPattern\]\]/gc) { + if (m/\G\[\[\#$FreeLinkPattern\]\]/cg) { return $q->a({-href=>'#' . FreeToNormal($1), -class=>'local anchor'}, $1); - } elsif ($BracketWiki && m/\G\[\[\#$FreeLinkPattern\|([^\]]+)\]\]/gc) { + } elsif ($BracketWiki && m/\G\[\[\#$FreeLinkPattern\|([^\]]+)\]\]/cg) { return $q->a({-href=>'#' . FreeToNormal($1), -class=>'local anchor'}, $2); - } elsif ($BracketWiki && m/\G(\[\[$FreeLinkPattern\#$FreeLinkPattern\|([^\]]+)\]\])/cog - or m/\G(\[\[\[$FreeLinkPattern\#$FreeLinkPattern\]\]\])/cog - or m/\G(\[\[$FreeLinkPattern\#$FreeLinkPattern\]\])/cog) { + } elsif ($BracketWiki && m/\G(\[\[$FreeLinkPattern\#$FreeLinkPattern\|([^\]]+)\]\])/cg + or m/\G(\[\[\[$FreeLinkPattern\#$FreeLinkPattern\]\]\])/cg + or m/\G(\[\[$FreeLinkPattern\#$FreeLinkPattern\]\])/cg) { # This one is not a dirty rule because the output is always a page # link, never an edit link (unlike normal free links). my $bracket = (substr($1, 0, 3) eq '[[['); @@ -47,7 +47,7 @@ sub AnchorsRule { $text = $id unless $text; $text =~ s/_/ /g; return ScriptLink(UrlEncode($id), $text, $class, undef, $title); - } elsif (m/\G\[\:$FreeLinkPattern\]/gc) { + } elsif (m/\G\[\:$FreeLinkPattern\]/cg) { return $q->a({-name=>FreeToNormal($1), -class=>'anchor'}, ''); } return; diff --git a/modules/antispam.pl b/modules/antispam.pl index beb0c4de..a8f4c00b 100644 --- a/modules/antispam.pl +++ b/modules/antispam.pl @@ -34,7 +34,7 @@ push(@MyRules, \&MaskEmailRule); sub MaskEmailRule { # Allow [email@foo.bar Email Me] links - if (m/\G\[($EmailRegExp(\s\w+)*\s*)\]/igc) { + if (m/\G\[($EmailRegExp(\s\w+)*\s*)\]/cgi) { my $chunk = $1; $chunk =~ s/($EmailRegExp)//i; my $email = $1; @@ -51,7 +51,7 @@ sub MaskEmailRule { return "$chunk"; } - if (m/\G($EmailRegExp)/igc) { + if (m/\G($EmailRegExp)/cgi) { my $email = $1; if ($DoMaskEmail) { my $masked=""; diff --git a/modules/autolock.pl b/modules/autolock.pl index 9809427f..622200a1 100644 --- a/modules/autolock.pl +++ b/modules/autolock.pl @@ -175,7 +175,7 @@ sub UserCanEditAutoLockFix { return 0 if $LockOnCreation{$id} and not -f GetPageFile($id); # new page return 0 if !$EditAllowed or -f $NoEditFile; return 0 if $editing and UserIsBanned(); # this call is more expensive - return 0 if $EditAllowed >= 2 and (not $CommentsPrefix or $id !~ /^$CommentsPrefix/o); + return 0 if $EditAllowed >= 2 and (not $CommentsPrefix or $id !~ /^$CommentsPrefix/); return 1 if $EditAllowed >= 3 and ($comment or (GetParam('aftertext', '') and not GetParam('text', ''))); return 0 if $EditAllowed >= 3; return 1; diff --git a/modules/ban-contributors.pl b/modules/ban-contributors.pl index 36f6198c..ad384315 100644 --- a/modules/ban-contributors.pl +++ b/modules/ban-contributors.pl @@ -125,9 +125,9 @@ sub NewBanContributorsWriteRcLog { # we currently have the clean page loaded, so we need to reload # the spammed revision (there is a possible race condition here) my ($old) = GetTextRevision($Page{revision}-1, 1); - my %urls = map {$_ => 1 } $old =~ /$UrlPattern/og; + my %urls = map {$_ => 1 } $old =~ /$UrlPattern/g; # we open the file again to force a load of the despammed page - foreach my $url ($Page{text} =~ /$UrlPattern/og) { + foreach my $url ($Page{text} =~ /$UrlPattern/g) { delete($urls{$url}); } # we also remove any candidates that are already banned diff --git a/modules/bbcode.pl b/modules/bbcode.pl index 01f8065a..599c9b42 100644 --- a/modules/bbcode.pl +++ b/modules/bbcode.pl @@ -61,12 +61,12 @@ sub bbCodeRule { return AddHtmlEnvironment('strong', qq{class="highlight"}); } elsif ($tag eq 'url') { if ($option) { - $option =~ /^($UrlProtocols)/o; + $option =~ /^($UrlProtocols)/; my $class = "url $1"; return AddHtmlEnvironment('a', qq{href="$option" class="$class"}); } - elsif (/\G$FullUrlPattern\s*\[\/url\]/cogi) { + elsif (/\G$FullUrlPattern\s*\[\/url\]/cgi) { return GetUrl($1); }} - elsif ($tag eq 'img' and /\G$FullUrlPattern\s*\[\/img\]/cogi) { + elsif ($tag eq 'img' and /\G$FullUrlPattern\s*\[\/img\]/cgi) { return GetUrl($1, undef, undef, 1); } # force image elsif ($tag eq 'quote') { my $html = CloseHtmlEnvironments(); diff --git a/modules/blockquote.pl b/modules/blockquote.pl index 595ed87a..6b4fbe51 100644 --- a/modules/blockquote.pl +++ b/modules/blockquote.pl @@ -28,10 +28,10 @@ push(@MyRules, \&BlockQuoteRule); sub BlockQuoteRule { # indented text using : with the option of spanning multiple text # paragraphs (but not lists etc). - if (InElement('blockquote') && m/\G(\s*\n)+:[ \t]*/cog) { + if (InElement('blockquote') && m/\G(\s*\n)+:[ \t]*/cg) { return CloseHtmlEnvironmentUntil('blockquote') . AddHtmlEnvironment('p'); - } elsif ($bol && m/\G(\s*\n)*:[ \t]*/cog) { + } elsif ($bol && m/\G(\s*\n)*:[ \t]*/cg) { return CloseHtmlEnvironments() . AddHtmlEnvironment('blockquote') . AddHtmlEnvironment('p'); diff --git a/modules/calendar.pl b/modules/calendar.pl index 57c02cca..39222c0c 100644 --- a/modules/calendar.pl +++ b/modules/calendar.pl @@ -74,7 +74,7 @@ sub Cal { $link .= ScriptLink('action=collect;match=' . UrlEncode($re), $day, 'local collection' . $class); } $link; - }}ge; + }}eg; $cal =~ s{(\S+) (\d\d\d\d)}{{ my ($month_text, $year_text) = ($1, $2); my $date = sprintf("%d-%02d", $year, $mon); @@ -118,22 +118,22 @@ sub DoCollect { push(@MyRules, \&CalendarRule); sub CalendarRule { - if (/\G(calendar:(\d\d\d\d))/gc) { + if (/\G(calendar:(\d\d\d\d))/cg) { my $oldpos = pos; Clean(CloseHtmlEnvironments()); Dirty($1); PrintYearCalendar($2); pos = $oldpos; return AddHtmlEnvironment('p'); - } elsif (/\G(month:(\d\d\d\d)-(\d\d))/gc) { + } elsif (/\G(month:(\d\d\d\d)-(\d\d))/cg) { my $oldpos = pos; Clean(CloseHtmlEnvironments()); Dirty($1); print Cal($2, $3); pos = $oldpos; return AddHtmlEnvironment('p'); - } elsif (/\G(month:([+-]\d\d?))/gc - or /\G(\[\[month:([+-]\d\d?) $FreeLinkPattern\]\])/gc) { + } elsif (/\G(month:([+-]\d\d?))/cg + or /\G(\[\[month:([+-]\d\d?) $FreeLinkPattern\]\])/cg) { my $oldpos = pos; Clean(CloseHtmlEnvironments()); Dirty($1); diff --git a/modules/checkbox.pl b/modules/checkbox.pl index 1bcfea29..afe0babb 100644 --- a/modules/checkbox.pl +++ b/modules/checkbox.pl @@ -77,7 +77,7 @@ sub DoCheckBox{ $summary{$3} = 0 if $2 eq 'x' or $2 eq 'X'; "${1}[[ :${3}]]"; } - }eig; + }egi; SetParam('text', $text); SetParam('summary', join(', ', map { if ($summary{$_}) { diff --git a/modules/clustermap.pl b/modules/clustermap.pl index bd2b3fb8..c195afc1 100644 --- a/modules/clustermap.pl +++ b/modules/clustermap.pl @@ -62,7 +62,7 @@ foreach (@ClusterMapAdminPages){ } sub ClusterMapRule { - if (/\G^([\n\r]*\<\s*clustermap\s*\>\s*)$/mgc) { + if (/\G^([\n\r]*\<\s*clustermap\s*\>\s*)$/cgm) { Dirty($1); my $oldpos = pos; my $oldstr = $_; diff --git a/modules/comment-div-wrapper.pl b/modules/comment-div-wrapper.pl index 3011e661..d508948b 100644 --- a/modules/comment-div-wrapper.pl +++ b/modules/comment-div-wrapper.pl @@ -30,7 +30,7 @@ sub CommentDivWrapper { return $q->start_div({-class=>'userComment'}); } } - if ($OpenPageName =~ /$CommentsPattern/o) { + if ($OpenPageName =~ /$CommentsPattern/) { if ($bol and m/\G(\s*\n)*----+[ \t]*\n?/cg) { my $html = CloseHtmlEnvironments() . ($CommentDiv++ > 0 ? $q->end_div() : $q->h2({-class=>'commentsHeading'}, T('Comments:'))) . $q->start_div({-class=>'userComment'}) diff --git a/modules/commentcount.pl b/modules/commentcount.pl index 45e4242f..4ac582b9 100644 --- a/modules/commentcount.pl +++ b/modules/commentcount.pl @@ -52,7 +52,7 @@ sub NewCommentcountScriptLink { if ($CommentsPrefix && $action =~ /^$CommentsPrefix(.*)/) { # TODO use $CommentsPattern ? # Add the number of comments here my $id = $action; - $id =~ s/%([0-9a-f][0-9a-f])/chr(hex($1))/ge; # undo urlencode + $id =~ s/%([0-9a-f][0-9a-f])/chr(hex($1))/eg; # undo urlencode my $comments = GetPageContent($id); my $num = 0; if($comments =~ /=== (\d+) Comments?\. ===/) { diff --git a/modules/creole.pl b/modules/creole.pl index 83d923f0..b69e9ad6 100644 --- a/modules/creole.pl +++ b/modules/creole.pl @@ -218,7 +218,7 @@ sub CreoleRule { } # escape next char (and prevent // in URLs from enabling italics) # ~ - elsif (m/\G(~($FullUrlPattern|\S))/cgo) { + elsif (m/\G(~($FullUrlPattern|\S))/cg) { return ($CreoleTildeAlternative and index( 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' @@ -234,12 +234,12 @@ sub CreoleRule { # {{{preformatted code}}} elsif (m/\G\{\{\{(.*?}*)\}\}\}/cg) { return $q->code($1); } # download: {{pic}} and {{pic|text}} - elsif (m/\G(\{\{$FreeLinkPattern$CreoleLinkTextPattern\}\})/cgos) { + elsif (m/\G(\{\{$FreeLinkPattern$CreoleLinkTextPattern\}\})/cgs) { my $text = $4 || $2; return GetCreoleLinkHtml($1, GetDownloadLink(FreeToNormal($2), 1, undef, $text), $text); } # image link: {{url}} and {{url|text}} - elsif (m/\G\{\{$FullUrlPattern$CreoleLinkTextPattern\}\}/cgos) { + elsif (m/\G\{\{$FullUrlPattern$CreoleLinkTextPattern\}\}/cgs) { return GetCreoleImageHtml( $q->a({-href=> UnquoteHtml($1), -class=> 'image outside'}, @@ -250,7 +250,7 @@ sub CreoleRule { } # image link: [[link|{{pic}}]] and [[link|{{pic|text}}]] elsif (m/\G(\[\[$FreeLinkPattern$CreoleLinkPipePattern - \{\{$FreeLinkPattern$CreoleLinkTextPattern\}\}\]\])/cgosx) { + \{\{$FreeLinkPattern$CreoleLinkTextPattern\}\}\]\])/cgsx) { my $text = $5 || $2; return GetCreoleLinkHtml($1, GetCreoleImageHtml( ScriptLink(UrlEncode(FreeToNormal($2)), @@ -261,7 +261,7 @@ sub CreoleRule { } # image link: [[link|{{url}}]] and [[link|{{url|text}}]] elsif (m/\G(\[\[$FreeLinkPattern$CreoleLinkPipePattern - \{\{$FullUrlPattern$CreoleLinkTextPattern\}\}\]\])/cgosx) { + \{\{$FullUrlPattern$CreoleLinkTextPattern\}\}\]\])/cgsx) { my $text = $5 || $2; return GetCreoleLinkHtml($1, GetCreoleImageHtml( ScriptLink(UrlEncode(FreeToNormal($2)), @@ -272,7 +272,7 @@ sub CreoleRule { } # image link: [[url|{{pic}}]] and [[url|{{pic|text}}]] elsif (m/\G(\[\[$FullUrlPattern$CreoleLinkPipePattern - \{\{$FreeLinkPattern$CreoleLinkTextPattern\}\}\]\])/cgosx) { + \{\{$FreeLinkPattern$CreoleLinkTextPattern\}\}\]\])/cgsx) { my $text = $5 || $2; return GetCreoleLinkHtml($1, GetCreoleImageHtml( $q->a({-href=> UnquoteHtml($2), -class=> 'image outside'}, @@ -283,7 +283,7 @@ sub CreoleRule { } # image link: [[url|{{url}}]] and [[url|{{url|text}}]] elsif (m/\G\[\[$FullUrlPattern$CreoleLinkPipePattern - \{\{$FullUrlPattern$CreoleLinkTextPattern\}\}\]\]/cgosx) { + \{\{$FullUrlPattern$CreoleLinkTextPattern\}\}\]\]/cgsx) { return GetCreoleImageHtml( $q->a({-href=> UnquoteHtml($1), -class=> 'image outside'}, $q->img({-src=> UnquoteHtml($2), @@ -292,7 +292,7 @@ sub CreoleRule { -class=> 'url outside'}))); } # link: [[url]] and [[url|text]] - elsif (m/\G\[\[$FullUrlPattern$CreoleLinkTextPattern\]\]/cgos) { + elsif (m/\G\[\[$FullUrlPattern$CreoleLinkTextPattern\]\]/cgs) { # Permit embedding of Creole syntax within link text. (Rather complicated, # but it does the job remarkably.) my $link_url = $1; @@ -305,7 +305,7 @@ sub CreoleRule { return GetUrl($link_url, $link_text, 1); } # link: [[page]] and [[page|text]] - elsif (m/\G(\[\[$FreeLinkPattern$CreoleLinkTextPattern\]\])/cgos) { + elsif (m/\G(\[\[$FreeLinkPattern$CreoleLinkTextPattern\]\])/cgs) { my $markup = $1; my $page_name = $2; my $link_text = $4 ? CreoleRuleRecursive($4, @_) : $page_name; @@ -315,7 +315,7 @@ sub CreoleRule { } # interlink: [[Wiki:page]] and [[Wiki:page|text]] elsif ($is_interlinking and - m/\G(\[\[$FreeInterLinkPattern$CreoleLinkTextPattern\]\])/cgos) { + m/\G(\[\[$FreeInterLinkPattern$CreoleLinkTextPattern\]\])/cgs) { my $markup = $1; my $interlink = $2; my $interlink_text = $4; diff --git a/modules/crumbs.pl b/modules/crumbs.pl index e750da45..5e57b5c4 100644 --- a/modules/crumbs.pl +++ b/modules/crumbs.pl @@ -28,8 +28,8 @@ $RuleOrder{\&CrumbsRule} = -10; # run before default rules! sub CrumbsRule { if (not (pos) # first! - and (($WikiLinks && /\G($LinkPattern\n)/cgo) - or ($FreeLinks && /\G(\[\[$FreeLinkPattern\]\]\n)/cgo))) { + and (($WikiLinks && /\G($LinkPattern\n)/cg) + or ($FreeLinks && /\G(\[\[$FreeLinkPattern\]\]\n)/cg))) { my $oldpos = pos; # will be trashed below my $cluster = FreeToNormal($2); my %seen = ($cluster => 1); diff --git a/modules/dojo.pl b/modules/dojo.pl index 9e04aea9..3dc1b098 100644 --- a/modules/dojo.pl +++ b/modules/dojo.pl @@ -30,7 +30,7 @@ $DojoTheme = 'tundra'; push (@MyRules, \&WysiwygRule); sub WysiwygRule { - if (m/\G(<.*?>)/gc) { + if (m/\G(<.*?>)/cg) { return $1 if substr($1,5,6) eq 'script' or substr($1,4,6) eq 'script'; return UnquoteHtml($1); diff --git a/modules/download.pl b/modules/download.pl index 2fd0aeb7..2b009a46 100644 --- a/modules/download.pl +++ b/modules/download.pl @@ -28,8 +28,8 @@ push( @MyRules, \&DownloadSupportRule ); # [[download:page name|alternate title]] sub DownloadSupportRule { - if (m/\G(\[\[download:$FreeLinkPattern\|([^\]]+)\]\])/cog - or m!\G(\[\[download:$FreeLinkPattern\]\])!cog) { + if (m/\G(\[\[download:$FreeLinkPattern\|([^\]]+)\]\])/cg + or m!\G(\[\[download:$FreeLinkPattern\]\])!cg) { Dirty($1); print GetDownloadLink($2, undef, undef, $3); return ''; diff --git a/modules/emailquote.pl b/modules/emailquote.pl index 3795a810..234243db 100644 --- a/modules/emailquote.pl +++ b/modules/emailquote.pl @@ -21,14 +21,14 @@ push(@MyRules, \&EmailQuoteRule); sub EmailQuoteRule { # > on a line of its own should work - if ($bol && m/\G(\s*\n)*((\>))+\n/cog) { + if ($bol && m/\G(\s*\n)*((\>))+\n/cg) { return $q->p(); } # > hi, you mentioned that: # >> I don't like Oddmuse. # > in last letter. - elsif ($bol && m/\G(\s*\n)*((\>)+)[ \t]/cog - or InElement('dd') && m/\G(\s*\n)+((\>)+)[ \t]/cog) { + elsif ($bol && m/\G(\s*\n)*((\>)+)[ \t]/cg + or InElement('dd') && m/\G(\s*\n)+((\>)+)[ \t]/cg) { my $leng = length($2) / 4; return CloseHtmlEnvironmentUntil('dd') . OpenHtmlEnvironment('dl',$leng, 'quote') . $q->dt() . AddHtmlEnvironment('dd'); diff --git a/modules/enclosure.pl b/modules/enclosure.pl index bea278ad..45aca628 100644 --- a/modules/enclosure.pl +++ b/modules/enclosure.pl @@ -28,7 +28,7 @@ push(@MyRules, \&EnclosureRule); # [[enclosure:url|size in bytes|mime type]] sub EnclosureRule { - if (m!\G\[\[enclosure:\s*$FreeLinkPattern(\|([^\]]+))?\]\]!ogci) { + if (m!\G\[\[enclosure:\s*$FreeLinkPattern(\|([^\]]+))?\]\]!cgi) { my $id = FreeToNormal($1); # Make sure we don't add duplicates; we will add non-existing # enclosures as well. We test for existence only when the RSS feed diff --git a/modules/faq.pl b/modules/faq.pl index f4edb10f..58824003 100644 --- a/modules/faq.pl +++ b/modules/faq.pl @@ -38,10 +38,10 @@ $FaqAnswerText = "Answer: " unless $FaqAnswerText; push(@MyRules, \&FaqRule); sub FaqRule { - if ($bol && m/\GQ: (.+)/gc) { + if ($bol && m/\GQ: (.+)/cg) { return $q->a({name=>'FAQ_' . UrlEncode($1)},'') . $q->div({class=>'question'}, $FaqQuestionText . $1); - } elsif ($bol && m/\GA:[ \t]*/gc) { + } elsif ($bol && m/\GA:[ \t]*/cg) { return CloseHtmlEnvironments() . AddHtmlEnvironment('div', "class='answer'") . $FaqAnswerText; } diff --git a/modules/fckeditor.pl b/modules/fckeditor.pl index 49de81ca..d031545f 100644 --- a/modules/fckeditor.pl +++ b/modules/fckeditor.pl @@ -29,7 +29,7 @@ $FCKeditorHeight = 400; # Pixel push (@MyRules, \&WysiwygRule); sub WysiwygRule { - if (m/\G(<.*?>)/gc) { + if (m/\G(<.*?>)/cg) { return $1 if substr($1,5,6) eq 'script' or substr($1,4,6) eq 'script'; return UnquoteHtml($1); diff --git a/modules/flickrgallery.pl b/modules/flickrgallery.pl index f7364a73..0c369373 100644 --- a/modules/flickrgallery.pl +++ b/modules/flickrgallery.pl @@ -66,7 +66,7 @@ $RuleOrder{\&FlickrGalleryRule} = -10; sub FlickrGalleryRule { # This code is used when Markdown is not available - if (/\G^([\n\r]*\<\s*FlickrSet:\s*(\d+)\s*\>\s*)$/mgci) { + if (/\G^([\n\r]*\<\s*FlickrSet:\s*(\d+)\s*\>\s*)$/cgim) { my $oldpos = pos; my $oldstr = $_; @@ -79,7 +79,7 @@ sub FlickrGalleryRule { return ''; } - if (/\G^([\n\r]*\<\s*FlickrPhoto:\s*(\d+)\s*([a-z0-9]*?)\s*($size)?\s*\>\s*)$/mgci) { + if (/\G^([\n\r]*\<\s*FlickrPhoto:\s*(\d+)\s*([a-z0-9]*?)\s*($size)?\s*\>\s*)$/cgim) { my $oldpos = pos; my $oldstr = $_; @@ -103,13 +103,13 @@ sub MarkdownFlickrGalleryRule { ^<FlickrSet:\s*(\d+)\s*\> }{ FlickrGallery($1); - }xmgei; + }egimx; $text =~ s{ ^<FlickrPhoto:\s*(\d+)\s*([a-z0-9]*?)\s*($size)?\s*\> }{ GetFlickrPhoto($1,$2,$3); - }xmgei; + }egimx; return $text } @@ -135,7 +135,7 @@ sub FlickrGallery { $result = $FlickrHeaderTemplate; - $result =~ s/(\$[a-zA-Z\d]+)/"defined $1 ? $1 : ''"/gee; + $result =~ s/(\$[a-zA-Z\d]+)/"defined $1 ? $1 : ''"/eeg; # Get list of photos and process them $url = $FlickrBaseUrl . "?method=flickr.photosets.getPhotos&api_key=" . @@ -153,7 +153,7 @@ sub FlickrGallery { my $footer = $FlickrFooterTemplate; - $footer =~ s/(\$[a-zA-Z\d]+)/"defined $1 ? $1 : ''"/gee; + $footer =~ s/(\$[a-zA-Z\d]+)/"defined $1 ? $1 : ''"/eeg; $result .= $footer; return $result; @@ -192,7 +192,7 @@ sub FlickrPhoto { my $output = $FlickrImageTemplate; - $output =~ s/(\$[a-zA-Z\d]+)/"defined $1 ? $1 : ''"/gee; + $output =~ s/(\$[a-zA-Z\d]+)/"defined $1 ? $1 : ''"/eeg; return $output } diff --git a/modules/footnotes.pl b/modules/footnotes.pl index c7f06977..d48f4a6e 100644 --- a/modules/footnotes.pl +++ b/modules/footnotes.pl @@ -242,13 +242,13 @@ sub FootnotesRule { # Footnotes and the set of all footnotes must be marked so as to ensure their # reevaluation, as each of the footnotes might contain Wiki markup requiring # reevaluation (like, say, free links). - if (m/\G($FootnotePattern)(?=([ \t]*$FootnotePattern)?)/gcos) { + if (m/\G($FootnotePattern)(?=([ \t]*$FootnotePattern)?)/cgs) { Dirty($1); # do not cache the prefixing "\G" my $footnote_text = $2; my $is_adjacent_footnote = defined $3; # A number range (e.g., "2-5") of references to other footnotes. - if ($footnote_text =~ m/^(\d+)-(\d+)$/o) { + if ($footnote_text =~ m/^(\d+)-(\d+)$/) { my ($footnote_number_first, $footnote_number_last) = ($1, $2); # '–', below, is the HTML entity for a Unicode en-dash. print $q->a({-href=> '#footnotes' .$footnote_number_first, @@ -261,7 +261,7 @@ sub FootnotesRule { }, $footnote_number_last.($is_adjacent_footnote ? ', ' : '')); } # A number (e.g., "5") implying reference to another footnote. - elsif ($footnote_text =~ m/^(\d+)$/o) { + elsif ($footnote_text =~ m/^(\d+)$/) { my $footnote_number = $1; print $q->a({-href=> '#footnotes' .$footnote_number, -title=> 'Footnote #'.$footnote_number, @@ -285,7 +285,7 @@ sub FootnotesRule { return ''; } # The "" list of all footnotes at the foot of a page. - elsif ($bol && m/\G($FootnotesPattern)/gcios) { + elsif ($bol && m/\G($FootnotesPattern)/cgis) { Clean(CloseHtmlEnvironments()); Dirty($1); # do not cache the prefixing "\G" diff --git a/modules/forms.pl b/modules/forms.pl index 1b7e566c..19a47db1 100644 --- a/modules/forms.pl +++ b/modules/forms.pl @@ -19,9 +19,9 @@ sub FormsRule { my $oldpos = pos; Clean(CloseHtmlEnvironments()); Dirty($form); - $form =~ s/\%([a-z]+)\%/GetParam($1)/ge; + $form =~ s/\%([a-z]+)\%/GetParam($1)/eg; $form =~ s/\$([a-z]+)\$/$q->span({-class=>'param'}, GetParam($1)) - .$q->input({-type=>'hidden', -name=>$1, -value=>GetParam($1)})/ge; + .$q->input({-type=>'hidden', -name=>$1, -value=>GetParam($1)})/eg; print UnquoteHtml($form); pos = $oldpos; return AddHtmlEnvironment('p'); diff --git a/modules/gotobar.pl b/modules/gotobar.pl index 5265f681..a4224f84 100644 --- a/modules/gotobar.pl +++ b/modules/gotobar.pl @@ -39,7 +39,7 @@ sub GotobarInit { @UserGotoBarPages = (); $UserGotoBar = ''; my $count = 0; - while ($Page{text} =~ m/($LinkPattern|\[\[$FreeLinkPattern\]\]|\[\[$FreeLinkPattern\|([^\]]+)\]\]|\[$InterLinkPattern\s+([^\]]+?)\]|\[$FullUrlPattern[|[:space:]]([^\]]+?)\])/og) { + while ($Page{text} =~ m/($LinkPattern|\[\[$FreeLinkPattern\]\]|\[\[$FreeLinkPattern\|([^\]]+)\]\]|\[$InterLinkPattern\s+([^\]]+?)\]|\[$FullUrlPattern[|[:space:]]([^\]]+?)\])/g) { my $page = $2||$3||$4||$6||$8; my $text = $5||$7||$9; $UserGotoBar .= ' ' if $UserGotoBar; diff --git a/modules/gravatar.pl b/modules/gravatar.pl index 8ded163f..ce819ab1 100644 --- a/modules/gravatar.pl +++ b/modules/gravatar.pl @@ -29,7 +29,7 @@ my $gravatar_regexp = "\\[\\[gravatar:(?:$FullUrlPattern )?([^\n:]+):([0-9a-f]+) push(@MyRules, \&GravatarRule); sub GravatarRule { - if ($bol && m!\G$gravatar_regexp!cog) { + if ($bol && m!\G$gravatar_regexp!cg) { my $url = $1; my $gravatar = "https://secure.gravatar.com/avatar/$3"; my $name = FreeToNormal($2); @@ -90,6 +90,6 @@ sub AddGravatar { sub GravatarNewGetSummary { my $summary = GravatarOldGetSummary(@_); - $summary =~ s/^$gravatar_regexp *//o; + $summary =~ s/^$gravatar_regexp *//; return $summary; } diff --git a/modules/grep.pl b/modules/grep.pl index f335eae7..23c1d0b8 100644 --- a/modules/grep.pl +++ b/modules/grep.pl @@ -45,7 +45,7 @@ sub PrintGrep { foreach my $id (AllPagesList()) { my $text = GetPageContent($id); next if (TextIsFile($text)); # skip files - while ($text =~ m{($regexp)}ig) { + while ($text =~ m{($regexp)}gi) { print $q->li(GetPageLink($id) . ': ' . $1); } } diff --git a/modules/headers.pl b/modules/headers.pl index a67e8c6c..240ec7bc 100644 --- a/modules/headers.pl +++ b/modules/headers.pl @@ -41,7 +41,7 @@ $RuleOrder{\&HeadersRule} = 95; sub HeadersRule { my $oldpos = pos; - if ($bol && (m/\G((.+?)[ \t]*\n(---+|===+)[ \t]*\n)/gc)) { + if ($bol && (m/\G((.+?)[ \t]*\n(---+|===+)[ \t]*\n)/cg)) { my $html = CloseHtmlEnvironments() . ($PortraitSupportColorDiv ? '' : ''); if (substr($3,0,1) eq '=') { $html .= $q->h2($2); diff --git a/modules/headlines.pl b/modules/headlines.pl index e0565ade..e89ee174 100644 --- a/modules/headlines.pl +++ b/modules/headlines.pl @@ -32,7 +32,7 @@ push(@MyRules, \&HeadlinesRule); $HeadlineNumber = 20; sub HeadlinesRule { - if (m/\G(\<headlines(:(\d+))?\>)/gci) { + if (m/\G(\<headlines(:(\d+))?\>)/cgi) { if (($3) and ($3>0)) {$HeadlineNumber = $3;}; Clean(CloseHtmlEnvironments()); Dirty($1); diff --git a/modules/hibernal.pl b/modules/hibernal.pl index c3d884ad..d381fe1e 100644 --- a/modules/hibernal.pl +++ b/modules/hibernal.pl @@ -1212,7 +1212,7 @@ sub GetHibernalArchiveMonth { ~e; $html_month =~ s~( {1,2})(\d{1,2})\b~ $1.GetHibernalArchiveMonthDay($post_name_regexp, $year, $month, $2) - ~ge; + ~eg; # Float the HTML for each month horizontally past the month preceding it; # failure to float months in this manner causes these months to stack diff --git a/modules/image.pl b/modules/image.pl index edd73ebe..da489895 100644 --- a/modules/image.pl +++ b/modules/image.pl @@ -32,7 +32,7 @@ push(@MyRules, \&ImageSupportRule); sub ImageSupportRule { my $result = undef; - if (m!\G\[\[image((/[a-z]+)*)( external)?:\s*([^]|]+?)\s*(\|[^]|]+?)?\s*(\|[^]|]*?)?\s*(\|[^]|]*?)?\s*(\|[^]|]*?)?\s*\]\](\{([^}]+)\})?!gc) { + if (m!\G\[\[image((/[a-z]+)*)( external)?:\s*([^]|]+?)\s*(\|[^]|]+?)?\s*(\|[^]|]*?)?\s*(\|[^]|]*?)?\s*(\|[^]|]*?)?\s*\]\](\{([^}]+)\})?!cg) { my $oldpos = pos; my $class = 'image' . $1; my $external = $3; diff --git a/modules/irc.pl b/modules/irc.pl index ac7e6b57..b4330c0d 100644 --- a/modules/irc.pl +++ b/modules/irc.pl @@ -33,7 +33,7 @@ $IrcLinkNick = 0; # This adds an extra
at the beginning. Alternatively, add it to # the last line, or only add it when required. sub IrcRule { - if ($bol && m/\G(?:\[?(\d\d?:\d\d(?:am|pm)?)\]?)?\s*<($IrcNickRegexp)> ?/gc) { + if ($bol && m/\G(?:\[?(\d\d?:\d\d(?:am|pm)?)\]?)?\s*<($IrcNickRegexp)> ?/cg) { my ($time, $nick) = ($1, $2); my ($error) = ValidId($nick); # if we're in a dl, close the open dd but not the dl. (if we're diff --git a/modules/lang.pl b/modules/lang.pl index aefaa8d5..8cd433d3 100644 --- a/modules/lang.pl +++ b/modules/lang.pl @@ -33,7 +33,7 @@ our ($q, @HtmlStack, @MyRules, $FullUrl); push(@MyRules, \&LangRule); sub LangRule { - if (m/\G\[([a-z][a-z])\]/gc) { + if (m/\G\[([a-z][a-z])\]/cg) { my $html; $html .= "" if $HtmlStack[0] eq 'span'; return $html . AddHtmlEnvironment('span', "lang=\"$1\"") . "[$1]"; diff --git a/modules/latex.pl b/modules/latex.pl index 58646df4..911839bf 100644 --- a/modules/latex.pl +++ b/modules/latex.pl @@ -98,7 +98,7 @@ EOT push(@MyRules, \&LatexRule); sub LatexRule { - if (m/\G\\\[(\(.*?\))?((.*\n)*?.*?)\\\]/gc) { + if (m/\G\\\[(\(.*?\))?((.*\n)*?.*?)\\\]/cg) { my $label = $1; my $latex = $2; $label =~ s#\(?\)?##g;# Remove the ()'s from the label and convert case @@ -106,13 +106,13 @@ sub LatexRule { $eqCounter++; $eqHash{$label} = $eqCounter; return &MakeLaTeX("\\begin{displaymath} $latex \\end{displaymath}", "display math",$label); - } elsif (m/\G\$\$((.*\n)*?.*?)\$\$/gc) { + } elsif (m/\G\$\$((.*\n)*?.*?)\$\$/cg) { return &MakeLaTeX("\$\$ $1 \$\$", $LatexSingleDollars ? "display math" : "inline math"); - } elsif ($LatexSingleDollars and m/\G\$((.*\n)*?.*?)\$/gc) { + } elsif ($LatexSingleDollars and m/\G\$((.*\n)*?.*?)\$/cg) { return &MakeLaTeX("\$ $1 \$", "inline math"); - } elsif ($allowPlainLaTeX && m/\G\$\[((.*\n)*?.*?)\]\$/gc) { #Pick up plain LaTeX commands + } elsif ($allowPlainLaTeX && m/\G\$\[((.*\n)*?.*?)\]\$/cg) { #Pick up plain LaTeX commands return &MakeLaTeX(" $1 ", "LaTeX"); - } elsif (m/\GEQ\((.*?)\)/gc) { # Handle references to equations + } elsif (m/\GEQ\((.*?)\)/cg) { # Handle references to equations my $label = $1; $label =~ tr/A-Z/a-z/; if ($eqHash{$label}) { @@ -166,7 +166,7 @@ sub MakeLaTeX { close $F; } my $template = ReadFileOrDie($LatexDefaultTemplateName); - $template =~ s//$latex/ig; + $template =~ s//$latex/gi; #setup rendering directory my $dir = "$LatexDir/$hash"; if (-d $dir) { diff --git a/modules/link-all.pl b/modules/link-all.pl index 164ab6af..31f25649 100644 --- a/modules/link-all.pl +++ b/modules/link-all.pl @@ -23,7 +23,7 @@ push(@MyRules, \&LinkAllRule); $RuleOrder{\&LinkAllRule} = 1000; sub LinkAllRule { - if (/\G([A-Za-z\x{0080}-\x{fffd}]+)/gc) { + if (/\G([A-Za-z\x{0080}-\x{fffd}]+)/cg) { my $oldpos = pos; Dirty($1); # print the word, or the link to the word diff --git a/modules/links.pl b/modules/links.pl index c3940426..f2dd4401 100644 --- a/modules/links.pl +++ b/modules/links.pl @@ -71,31 +71,31 @@ sub GetLinkList { # for the currently open page my %links; foreach my $block (@blocks) { if (shift(@flags)) { # dirty block and interlinks or normal links - if ($inter and ($BracketText && $block =~ m/^(\[$InterLinkPattern\s+([^\]]+?)\])$/o - or $BracketText && $block =~ m/^(\[\[$FreeInterLinkPattern\|([^\]]+?)\]\])$/o - or $block =~ m/^(\[$InterLinkPattern\])$/o - or $block =~ m/^(\[\[\[$FreeInterLinkPattern\]\]\])$/o - or $block =~ m/^($InterLinkPattern)$/o - or $block =~ m/^(\[\[$FreeInterLinkPattern\]\])$/o)) { + if ($inter and ($BracketText && $block =~ m/^(\[$InterLinkPattern\s+([^\]]+?)\])$/ + or $BracketText && $block =~ m/^(\[\[$FreeInterLinkPattern\|([^\]]+?)\]\])$/ + or $block =~ m/^(\[$InterLinkPattern\])$/ + or $block =~ m/^(\[\[\[$FreeInterLinkPattern\]\]\])$/ + or $block =~ m/^($InterLinkPattern)$/ + or $block =~ m/^(\[\[$FreeInterLinkPattern\]\])$/)) { $links{$raw ? $2 : GetInterLink($2, $3)} = 1 if $InterSite{substr($2,0,index($2, ':'))}; } elsif ($link - and (($WikiLinks and $block !~ m/!$LinkPattern/o - and ($BracketWiki && $block =~ m/^(\[$LinkPattern\s+([^\]]+?)\])$/o - or $block =~ m/^(\[$LinkPattern\])$/o - or $block =~ m/^($LinkPattern)$/o)) + and (($WikiLinks and $block !~ m/!$LinkPattern/ + and ($BracketWiki && $block =~ m/^(\[$LinkPattern\s+([^\]]+?)\])$/ + or $block =~ m/^(\[$LinkPattern\])$/ + or $block =~ m/^($LinkPattern)$/)) or ($FreeLinks - and ($BracketWiki && $block =~ m/^(\[\[$FreeLinkPattern\|([^\]]+)\]\])$/o - or $block =~ m/^(\[\[\[$FreeLinkPattern\]\]\])$/o - or $block =~ m/^(\[\[$FreeLinkPattern\]\])$/o)))) { + and ($BracketWiki && $block =~ m/^(\[\[$FreeLinkPattern\|([^\]]+)\]\])$/ + or $block =~ m/^(\[\[\[$FreeLinkPattern\]\]\])$/ + or $block =~ m/^(\[\[$FreeLinkPattern\]\])$/)))) { $links{$raw ? FreeToNormal($2) : GetPageOrEditLink($2, $3)} = 1; - } elsif ($url and $block =~ m/^\[$FullUrlPattern\]$/og) { + } elsif ($url and $block =~ m/^\[$FullUrlPattern\]$/g) { $links{$raw ? $1 : GetUrl($1)} = 1; } } elsif ($url) { # clean block and url - while ($block =~ m/$UrlPattern/og) { + while ($block =~ m/$UrlPattern/g) { $links{$raw ? $1 : GetUrl($1)} = 1; } - while ($block =~ m/\[$FullUrlPattern\s+[^\]]+?\]/og) { + while ($block =~ m/\[$FullUrlPattern\s+[^\]]+?\]/g) { $links{$raw ? $1 : GetUrl($1)} = 1; } } diff --git a/modules/linktagmap.pl b/modules/linktagmap.pl index 839a65c6..be211360 100644 --- a/modules/linktagmap.pl +++ b/modules/linktagmap.pl @@ -52,7 +52,7 @@ push (@MyRules, \&LinkTagRule, \&LinkDescriptionRule); sub LinkTagRule { # Process link tags on a page - if ( m/\G$LinkTagMark(.*?)$LinkTagMark/gc) { # find tags + if ( m/\G$LinkTagMark(.*?)$LinkTagMark/cg) { # find tags my @linktags = split /,\s*/, $1; # push them in array @linktags = map { # and generate html output: qq{$_}; # each tag is a link to search all links with that tag @@ -66,7 +66,7 @@ sub LinkTagRule { # Process link tags on a page sub LinkDescriptionRule { # Process link descriptions on a page - if ( m/\G$LinkDescMark(.*?)$LinkDescMark/gc) { # find description + if ( m/\G$LinkDescMark(.*?)$LinkDescMark/cg) { # find description return qq{$1}; # put it in SPAN block } return; @@ -184,7 +184,7 @@ sub PrintLinkTagMap { my $tag = $1; "
  • $tag
  • \n