Author Topic: 404 Not Found Server Error  (Read 7025 times)

0 Members and 1 Guest are viewing this topic.

Offline Mars

  • Operator
  • Tireless poster
  • *****
  • Posts: 1890
    • View Profile
Re: 404 Not Found Server Error
« Reply #15 on: October 15, 2015, 02:25:24 PM »
the error "404 not found"  here  comes from this line in scriptlib.pas

s:=reReplace(s,'%([-a-z0-9]+%)',''$1', 'mi');

Regular Expression is the problem

/%([-a-z0-9]+%)/

    % matches the character % literally
    1st Capturing group ([-a-z0-9]+%)
        [-a-z0-9]+ match a single character present in the list below
            Quantifier: + Between one and unlimited times, as many times as possible, giving back as needed [greedy]
            - the literal character -
            a-z a single character in the range between a and z (case sensitive)
            0-9 a single character in the range between 0 and 9
        % matches the character % literally

I guess the purpose of this mask is to replace a variable of type %my_var% by its equivalent 'myvar

the problem is that detection also includes normally separated pairs of %xx

"New folder (2).txt"  --> converted in url to "New%20folder%20(2).txt"

by applying the mask:

"New%20folder%20(2).txt"  becomes "New'folder20(2).txt"

it's will be necessary to ignore replace when % is followed by a number,  because a hfs var always begin by a non numeric char

should be taken into account in the new version the following scenario:

"new %myvar%20 folders" -->> "new 'myvar20 folders"
 here, %20 is not a space character and have not to be converted

changing somewhat groping the mask could give a result that seems correct, but will require the approval of any modification to validate rejetto
« Last Edit: October 15, 2015, 05:23:02 PM by Mars »

Follow members gave a thank to your post:


Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12949
    • View Profile
Re: 404 Not Found Server Error
« Reply #16 on: October 17, 2015, 08:50:24 AM »
thanks mars, but i already fixed that problem.
Sadly, the starting-with-a-number is not a solution, because some (non-ASCII) characters start with a letter as well.

I'm now fixing this other problem before publishing, to avoid making many updates
http://www.rejetto.com/forum/bug-reports/descript-ion-and-comment-not-cleaned-up-after-moving-file/