litesoft
Diff Revisions
609
vs
610
for /trunk/Java/core/Server/src/org/litesoft/util/Utils.java
|
@@ -572,13 +572,17 @@ |
572 |
572 |
|
} |
573 |
573 |
|
} |
574 |
574 |
|
|
575 |
|
- |
public static String fixPercemtsInURLs( String pURLtext ) |
|
575 |
+ |
public static String fixPercentsInURLs( String pURLtext ) |
576 |
576 |
|
{ |
577 |
577 |
|
if ( pURLtext != null ) |
578 |
578 |
|
{ |
579 |
|
- |
int zFrom = pURLtext.length() - 3; |
580 |
|
- |
for ( int zAt; (zFrom > -1) && (-1 != (zAt = pURLtext.lastIndexOf( '%', zFrom ))); zFrom = zAt - 3 ) |
|
579 |
+ |
int zFrom = 0; |
|
580 |
+ |
for ( int zAt; -1 != (zAt = pURLtext.indexOf( '%', zFrom )); zFrom = zAt + 1 ) |
581 |
581 |
|
{ |
|
582 |
+ |
if ( pURLtext.length() <= (zAt + 2) ) |
|
583 |
+ |
{ |
|
584 |
+ |
break; |
|
585 |
+ |
} |
582 |
586 |
|
int zHi = UtilsCommon.hexFor( pURLtext.charAt( zAt + 1 ) ); |
583 |
587 |
|
int zLo = UtilsCommon.hexFor( pURLtext.charAt( zAt + 2 ) ); |
584 |
588 |
|
if ( (zHi != -1) && (zLo != -1) ) |