Robin McDermot
06-14-06, 11:09 PM
Hi Folks,
A couple of years ago we had a problem with a CRLF getting passed properly to a file that is NOT miva on a different server. See a copy of our posting the the listserve below.
We worked around the problem by posting to a asp.net file on a third server, converting the crlf and then sending it off the the other server. Confusing, but it worked and life was good. We didn't have the asp.net file on our server because we are Linux/Apache.
Now, because our customer wants up to run through a secure (https) site, we cannot bounce off of the third party server and need again to work around this miva limitation.
1. If anyone knows how to workaround the limitation without using a different programming language, we will gladly pay you to help us with this.
2. If no one knows how to do this all in miva then we need to do a similar thing, but all on our server. We could use PHP or possibly PERL. Again, we would gladly pay for someone to do this for us.
We will even provide the asp.net code so it would (hopefully) just be a matter of translating it???
TIA,
Robin
Posting from Dec 2003:
Hello All,
Empressa Version 3.9.7 We are passing data from one server to another (AICC
data - AICC is a compliance standard for Learning Management Systems)
We have a problem with <MvCALL ... METHOD="POST".. where the data in a field
is being stripped out???
The data being stripped is CRLF - asciichar(13) $ asciichar(10)
The following is a small test script that posts to another mv file, this
actually works OK:
Name: testpost.mv
<MIVA STANDARDOUTPUTLEVEL="html,text,compresswhitespace">
<MvASSIGN NAME="l.crlf" VALUE="{asciichar(13) $ asciichar(10)}">
<MvASSIGN NAME="post_url" VALUE="{Enter a valid URL}/testpost1.mv">
<MvASSIGN NAME="command" VALUE="test">
<MvASSIGN NAME="terms"
VALUE="{'[core]'$l.crlf$'lesson_location=end'$l.crlf$'lesson_stat us=i'$l.crl
f$'score=50'$l.crlf$'time=00:23:15'}">
<FORM>
<MvHIDE FIELDS="command,terms">
</FORM>
<MvCALL
ACTION="{post_url}"
METHOD="POST"
FIELDS="command,terms">
<MvEVAL EXPR="{'Returned: ' $ callvalue}">
</MvCALL>
Name: testpost1.mv
<MIVA STANDARDOUTPUTLEVEL="html, text, compresswhitespace">
<MvASSIGN NAME="return_value" VALUE="{terms}">
<MvASSIGN NAME="new_return_value" VALUE="">
<MvASSIGN NAME="charCount" VALUE="{len(return_value)}">
<MvASSIGN NAME="charNum" VALUE="0">
<MvWHILE EXPR="{charNum LT charCount}">
<MvASSIGN NAME="charNum" VALUE="{charNum + 1}">
<MvASSIGN NAME="chr" VALUE="{substring(return_value,charNum,1)}">
<MvASSIGN NAME="ascii" VALUE="{asciivalue(chr)}">
<MvIF EXPR="{ascii EQ 13 OR ascii EQ 10}">
<MvIF EXPR="{ascii EQ 10}">
<MvASSIGN NAME="chr" VALUE="^">
<MvELSE>
<MvASSIGN NAME="chr" VALUE="|">
</MvIF>
</MvIF>
<MvASSIGN NAME="new_return_value" VALUE="{new_return_value $ chr}">
</MvWHILE>
<MvEVAL EXPR="{'terms = ' $ new_return_value}">
The output for the above is:
Returned: terms =
[core]|^lesson_location=end|^lesson_status=i|^score=50|^ time=00:23:15
Clearly this shows that the POST from Miva to Miva is passing the CRLF,
however if the ACTION is to another sever and not a Miva file the CRLF are
not received???
The following is the output when post_url is to a different site:
Returned: formString sent via POST with an encoding of:
application/x-www-form-urlencoded
command=test&terms=%5Bcore%5Dlesson_location%3Dendlesson_status %3Discore%3D5
0time%3D00%3A23%3A15 Returned:
Please note the "5Bcore%5Dlesson.." this is "[core]lesson..." it should be:
"5Bcore%5D%0D%0Alesson..." where %0D%0A is CRLF (asciichar(13) $
asciichar(10))
Is this a known issue??
A couple of years ago we had a problem with a CRLF getting passed properly to a file that is NOT miva on a different server. See a copy of our posting the the listserve below.
We worked around the problem by posting to a asp.net file on a third server, converting the crlf and then sending it off the the other server. Confusing, but it worked and life was good. We didn't have the asp.net file on our server because we are Linux/Apache.
Now, because our customer wants up to run through a secure (https) site, we cannot bounce off of the third party server and need again to work around this miva limitation.
1. If anyone knows how to workaround the limitation without using a different programming language, we will gladly pay you to help us with this.
2. If no one knows how to do this all in miva then we need to do a similar thing, but all on our server. We could use PHP or possibly PERL. Again, we would gladly pay for someone to do this for us.
We will even provide the asp.net code so it would (hopefully) just be a matter of translating it???
TIA,
Robin
Posting from Dec 2003:
Hello All,
Empressa Version 3.9.7 We are passing data from one server to another (AICC
data - AICC is a compliance standard for Learning Management Systems)
We have a problem with <MvCALL ... METHOD="POST".. where the data in a field
is being stripped out???
The data being stripped is CRLF - asciichar(13) $ asciichar(10)
The following is a small test script that posts to another mv file, this
actually works OK:
Name: testpost.mv
<MIVA STANDARDOUTPUTLEVEL="html,text,compresswhitespace">
<MvASSIGN NAME="l.crlf" VALUE="{asciichar(13) $ asciichar(10)}">
<MvASSIGN NAME="post_url" VALUE="{Enter a valid URL}/testpost1.mv">
<MvASSIGN NAME="command" VALUE="test">
<MvASSIGN NAME="terms"
VALUE="{'[core]'$l.crlf$'lesson_location=end'$l.crlf$'lesson_stat us=i'$l.crl
f$'score=50'$l.crlf$'time=00:23:15'}">
<FORM>
<MvHIDE FIELDS="command,terms">
</FORM>
<MvCALL
ACTION="{post_url}"
METHOD="POST"
FIELDS="command,terms">
<MvEVAL EXPR="{'Returned: ' $ callvalue}">
</MvCALL>
Name: testpost1.mv
<MIVA STANDARDOUTPUTLEVEL="html, text, compresswhitespace">
<MvASSIGN NAME="return_value" VALUE="{terms}">
<MvASSIGN NAME="new_return_value" VALUE="">
<MvASSIGN NAME="charCount" VALUE="{len(return_value)}">
<MvASSIGN NAME="charNum" VALUE="0">
<MvWHILE EXPR="{charNum LT charCount}">
<MvASSIGN NAME="charNum" VALUE="{charNum + 1}">
<MvASSIGN NAME="chr" VALUE="{substring(return_value,charNum,1)}">
<MvASSIGN NAME="ascii" VALUE="{asciivalue(chr)}">
<MvIF EXPR="{ascii EQ 13 OR ascii EQ 10}">
<MvIF EXPR="{ascii EQ 10}">
<MvASSIGN NAME="chr" VALUE="^">
<MvELSE>
<MvASSIGN NAME="chr" VALUE="|">
</MvIF>
</MvIF>
<MvASSIGN NAME="new_return_value" VALUE="{new_return_value $ chr}">
</MvWHILE>
<MvEVAL EXPR="{'terms = ' $ new_return_value}">
The output for the above is:
Returned: terms =
[core]|^lesson_location=end|^lesson_status=i|^score=50|^ time=00:23:15
Clearly this shows that the POST from Miva to Miva is passing the CRLF,
however if the ACTION is to another sever and not a Miva file the CRLF are
not received???
The following is the output when post_url is to a different site:
Returned: formString sent via POST with an encoding of:
application/x-www-form-urlencoded
command=test&terms=%5Bcore%5Dlesson_location%3Dendlesson_status %3Discore%3D5
0time%3D00%3A23%3A15 Returned:
Please note the "5Bcore%5Dlesson.." this is "[core]lesson..." it should be:
"5Bcore%5D%0D%0Alesson..." where %0D%0A is CRLF (asciichar(13) $
asciichar(10))
Is this a known issue??