View | Details | Raw Unified | Return to bug 27286
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/picture-upload.tt (+5 lines)
Lines 136-141 Link Here
136
                        <li><strong>This script is not able to create/write to the necessary temporary directory.</strong></li>
136
                        <li><strong>This script is not able to create/write to the necessary temporary directory.</strong></li>
137
                    [% ELSIF ( ERROR.EMPTYUPLOAD ) %]
137
                    [% ELSIF ( ERROR.EMPTYUPLOAD ) %]
138
                        <li><strong>The upload file appears to be empty.</strong></li>
138
                        <li><strong>The upload file appears to be empty.</strong></li>
139
                    [% ELSIF ( ERROR.BADFILENAME ) %]
140
                        <li>
141
                            <strong>The uploaded filename is invalid.
142
                            Filenames must have exactly one extension and no other periods (e.g. "patron.jpg", not "patron.v1.jpg").</strong>
143
                        </li>
139
                    [% ELSIF ( ERROR.OPNLINK ) %]
144
                    [% ELSIF ( ERROR.OPNLINK ) %]
140
                        <li
145
                        <li
141
                            ><strong>Cannot open [% ERROR.OPNLINK | html %] to read.<br />Please verify that it exists.</strong></li
146
                            ><strong>Cannot open [% ERROR.OPNLINK | html %] to read.<br />Please verify that it exists.</strong></li
(-)a/tools/picture-upload.pl (-1 / +6 lines)
Lines 97-102 if ( ( $op eq 'cud-Upload' ) && ( $uploadfile || $uploadfiletext ) ) { Link Here
97
    my $dirname = File::Temp::tempdir( CLEANUP => 1 );
97
    my $dirname = File::Temp::tempdir( CLEANUP => 1 );
98
    my $filesuffix;
98
    my $filesuffix;
99
    $uploadfilename =~ s/[^A-Za-z0-9\-\.]//g;
99
    $uploadfilename =~ s/[^A-Za-z0-9\-\.]//g;
100
101
    # Fix bug 27286
102
    if ( $uploadfilename !~ /^[^\.]+\.(png|gif|jpe?g|xpm|zip)$/i ) {
103
        $errors{'BADFILENAME'} = 1;
104
    }
105
100
    if ( $uploadfilename =~ m/(\..+)$/i ) {
106
    if ( $uploadfilename =~ m/(\..+)$/i ) {
101
        $filesuffix = $1;
107
        $filesuffix = $1;
102
    }
108
    }
103
- 

Return to bug 27286