Skip to content

Commit

Permalink
Item13644: fixed 2 deprecates unescaped left brace
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDaum committed Aug 31, 2015
1 parent 20afeca commit 86807a3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,5 +1,6 @@
*.gz
*.swp
igp_*
pub/System/ImageGalleryPlugin/style.css
ImageGalleryPlugin.md5
ImageGalleryPlugin.sha1
Expand Down
1 change: 1 addition & 0 deletions data/System/ImageGalleryPlugin.txt
Expand Up @@ -158,6 +158,7 @@ Note, that the $comment variable will only display =<comment>= , that is w
| Release: | %$RELEASE% |
| Version: | %$VERSION% |
| Change History: | <!-- versions below in reverse order -->&nbsp; |
| 31 Aug 2015: | fixing deprecated unescaped left brace in regexes |
| 16 Dec 2014 | add support for svg, tiff, xcf and psd |
| 28 Aug 2014 | only render the first frame of a gif animation generating thumbnails; fix orientation of thumbnail as specified in the EXIF metadata |
| 29 Nov 2012 | removed useless call to =expandCommonVariables=; removed non-functional <nop>UserListByPhotograph |
Expand Down
6 changes: 3 additions & 3 deletions lib/Foswiki/Plugins/ImageGalleryPlugin.pm
Expand Up @@ -18,8 +18,8 @@ use strict;
use warnings;

# =========================
our $VERSION = '7.00';
our $RELEASE = '7.00';
our $VERSION = '7.01';
our $RELEASE = '31 Aug 2015';
our $NO_PREFS_IN_TOPIC = 1;
our $SHORTDESCRIPTION = 'Displays image gallery with auto-generated thumbnails from attachments';
our $isInitialized;
Expand Down Expand Up @@ -75,7 +75,7 @@ sub renderImageGalleryPlaceholder {
sub postRenderingHandler {
# my $text = shift;

$_[0] =~ s/${TranslationToken}IMAGEGALLERY{(.*?)}$TranslationToken/renderImageGallery($1)/ge;
$_[0] =~ s/${TranslationToken}IMAGEGALLERY\{(.*?)\}$TranslationToken/renderImageGallery($1)/ge;
}

# =========================
Expand Down
6 changes: 3 additions & 3 deletions lib/Foswiki/Plugins/ImageGalleryPlugin/Core.pm
Expand Up @@ -250,7 +250,7 @@ sub render {
next if $found;
my $img = "$this->{igpDir}/$entry->{name}";
my $thumb = "$this->{igpDir}/thumb_$entry->{name}";
$entry->{name} =~ s/\.svgz?|tiff?|xcf|psd$/.png/i;
$entry->{name} =~ s/\.(svgz?|tiff?|xcf|psd)$/.png/i;

$img = $this->normalizeFileName($img);
$thumb = $this->normalizeFileName($thumb);
Expand Down Expand Up @@ -827,7 +827,7 @@ sub replaceVars {
if ($image) {

my $imageName = $image->{name};
$imageName =~ s/\.svgz?|tiff?|xcf|psd$/.png/i;
$imageName =~ s/\.(svgz?|tiff?|xcf|psd)$/.png/i;

$format =~ s/\$width/$image->{IGP_width}/gos;
$format =~ s/\$framewidth/($image->{IGP_width}+2)/ge;
Expand Down Expand Up @@ -875,7 +875,7 @@ sub processImage {
my $prefix = ($thumbMode)?'thumb_':'';

my $target = "$this->{igpDir}/$prefix$image->{name}";
$target =~ s/\.svgz?|tiff?|xcf|psd$/.png/i;
$target =~ s/\.(svgz?|tiff?|xcf|psd)$/.png/i;
$target = $this->normalizeFileName($target);

my $entry = $this->{info}{$image->{name}};
Expand Down

0 comments on commit 86807a3

Please sign in to comment.