File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -614,8 +614,10 @@ public String getImageName() throws SQLException {
614614 if (rs .next ()) {
615615 toret += rs .getString ("imageName" );
616616 }
617- if (toret .contains (".jpg" )) {
618- toret = toret .replaceAll ("\\ .jpg" , "" );
617+ // Strip .jpg/.JPG/.jpeg/.JPEG extension (case-insensitive)
618+ // This handles both new lowercase .jpg and old uppercase .JPG files
619+ if (toret .toLowerCase ().contains (".jpg" ) || toret .toLowerCase ().contains (".jpeg" )) {
620+ toret = toret .replaceAll ("(?i)\\ .jpe?g$" , "" );
619621 }
620622 return toret ;
621623 } finally {
@@ -640,8 +642,10 @@ public static String getImageName(String pageName) throws SQLException {
640642 if (rs .next ()) {
641643 toret += rs .getString ("imageName" );
642644 }
643- if (toret .contains (".jpg" )) {
644- toret = toret .replaceAll ("\\ .jpg" , "" );
645+ // Strip .jpg/.JPG/.jpeg/.JPEG extension (case-insensitive)
646+ // This handles both new lowercase .jpg and old uppercase .JPG files
647+ if (toret .toLowerCase ().contains (".jpg" ) || toret .toLowerCase ().contains (".jpeg" )) {
648+ toret = toret .replaceAll ("(?i)\\ .jpe?g$" , "" );
645649 }
646650 return toret ;
647651 } finally {
You can’t perform that action at this time.
0 commit comments