Rev 7743 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7743 | Rev 7758 | ||
---|---|---|---|
Line 212... | Line 212... | ||
212 | chrcat(_rez, '/'); |
212 | chrcat(_rez, '/'); |
213 | strcat(_rez, _new); |
213 | strcat(_rez, _new); |
214 | _GET_ABSOLUTE_URL_END: |
214 | _GET_ABSOLUTE_URL_END: |
215 | while (i=strstr(_rez, "&")) strcpy(i+1, i+5); |
215 | while (i=strstr(_rez, "&")) strcpy(i+1, i+5); |
216 | }1)>>=> |
216 | } |
- | 217 | ||
- | 218 | ||
- | 219 | :dword GetAbsoluteURL(dword new_URL, base_URL) |
|
- | 220 | { |
|
- | 221 | int i; |
|
- | 222 | dword orig_URL = new_URL; |
|
- | 223 | char newurl[URL_SIZE+1]; |
|
- | 224 | strcpy(#newurl, base_URL); |
|
- | 225 | ||
- | 226 | while (i=strstr(new_URL, "&")) strcpy(i+1, i+5); |
|
- | 227 | ||
- | 228 | if (check_is_the_url_absolute(new_URL)) return orig_URL; |
|
- | 229 | ||
- | 230 | IF (!strncmp(new_URL,"//", 2)) |
|
- | 231 | { |
|
- | 232 | strcpy(#newurl, "http:"); |
|
- | 233 | strcat(#newurl, new_URL); |
|
- | 234 | strcpy(orig_URL, #newurl); |
|
- | 235 | return orig_URL; |
|
- | 236 | } |
|
- | 237 | ||
- | 238 | IF (!strncmp(new_URL,"./", 2)) new_URL+=2; |
|
- | 239 | ||
- | 240 | if (ESBYTE[new_URL] == '/') //remove everything after site domain name |
|
- | 241 | { |
|
- | 242 | i = strchr(#newurl+8, '/'); |
|
- | 243 | if (i) ESBYTE[i]=0; |
|
- | 244 | new_URL+=1; |
|
- | 245 | } |
|
- | 246 | ||
- | 247 | _CUT_ST_LEVEL_MARK: |
|
- | 248 | ||
- | 249 | if (newurl[strrchr(#newurl, '/')-2]<>'/') |
|
- | 250 | { |
|
- | 251 | newurl[strrchr(#newurl, '/')] = 0x00; |
|
- | 252 | } |
|
- | 253 | ||
- | 254 | IF (!strncmp(new_URL,"../",3)) |
|
- | 255 | { |
|
- | 256 | new_URL+=3; |
|
- | 257 | newurl[strrchr(#newurl, '/')-1] = 0x00; |
|
- | 258 | goto _CUT_ST_LEVEL_MARK; |
|
- | 259 | } |
|
- | 260 | ||
- | 261 | if (newurl[strlen(#newurl)-1]<>'/') strcat(#newurl, "/"); |
|
- | 262 | ||
- | 263 | strcat(#newurl, new_URL); |
|
- | 264 | strcpy(orig_URL, #newurl); |
|
- | 265 | return orig_URL; |
|
- | 266 | }>>1)>>=> |