mirror of https://github.com/kiwix/libkiwix.git
* Fix an URL parsing issue impacting title containing a '/' (ID: 3065286)
This commit is contained in:
parent
459e6550b5
commit
d52c86bcac
|
@ -108,12 +108,12 @@ namespace kiwix {
|
||||||
unsigned int offset = 0;
|
unsigned int offset = 0;
|
||||||
|
|
||||||
/* Ignore the '/' */
|
/* Ignore the '/' */
|
||||||
while((offset < urlLength) && (url[offset] == '/')) offset++;
|
while ((offset < urlLength) && (url[offset] == '/')) offset++;
|
||||||
|
|
||||||
/* Get namespace */
|
/* Get namespace */
|
||||||
char ns[1024];
|
char ns[1024];
|
||||||
unsigned int nsOffset = 0;
|
unsigned int nsOffset = 0;
|
||||||
while((offset < urlLength) && (url[offset] != '/')) {
|
while ((offset < urlLength) && (url[offset] != '/')) {
|
||||||
ns[nsOffset] = url[offset];
|
ns[nsOffset] = url[offset];
|
||||||
offset++;
|
offset++;
|
||||||
nsOffset++;
|
nsOffset++;
|
||||||
|
@ -121,12 +121,12 @@ namespace kiwix {
|
||||||
ns[nsOffset] = 0;
|
ns[nsOffset] = 0;
|
||||||
|
|
||||||
/* Ignore the '/' */
|
/* Ignore the '/' */
|
||||||
while((offset < urlLength) && (url[offset] == '/')) offset++;
|
while ((offset < urlLength) && (url[offset] == '/')) offset++;
|
||||||
|
|
||||||
/* Get content title */
|
/* Get content title */
|
||||||
char title[1024];
|
char title[1024];
|
||||||
unsigned int titleOffset = 0;
|
unsigned int titleOffset = 0;
|
||||||
while((offset < urlLength) && (url[offset] != '/')) {
|
while (offset < urlLength) {
|
||||||
title[titleOffset] = url[offset];
|
title[titleOffset] = url[offset];
|
||||||
offset++;
|
offset++;
|
||||||
titleOffset++;
|
titleOffset++;
|
||||||
|
|
Loading…
Reference in New Issue