You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PHP has a feature to open the stream from string passed through RFC 2397 data:
protocol.
The SQLSRV help describes this feature to send the data as a stream to the MS-
SQL server.
However, data passed in „data:text/plain,…“ string should be either urlencoded
or base64 encoded. Otherwise serious damage of the data occurs, because when
data are not passed as base64, PHP urldecodes them (+ becomes space, %20
entities get decoded, etc.)
PROBLEM:
In the SQLSRV help, all source code lines opening stream from string should be
modified according the correct syntax.
Incorrect syntax: fopen( "data://text/plain,[ Insert lengthy comment here.]",
"r");
Correct syntax, option #1: fopen("data:text/plain,".urlencode('[ Insert
lengthy comment here.]')."", "r");
Correct syntax, option #2: fopen("data:text/plain;base64,".base64_encode('[
Insert lengthy comment here.]')."", "r");
Original CodePlex Issue:Issue 19139 Status: Proposed Reason Closed: Unassigned Assigned to: Unassigned Reported on: Nov 18, 2010 at 11:44 AM Reported by: michalkocarek Updated on: Nov 18, 2010 at 11:45 AM Updated by: michalkocarek
The text was updated successfully, but these errors were encountered:
PHP has a feature to open the stream from string passed through RFC 2397 data:
protocol.
The SQLSRV help describes this feature to send the data as a stream to the MS-
SQL server.
However, data passed in „data:text/plain,…“ string should be either urlencoded
or base64 encoded. Otherwise serious damage of the data occurs, because when
data are not passed as base64, PHP urldecodes them (+ becomes space, %20
entities get decoded, etc.)
PROBLEM:
In the SQLSRV help, all source code lines opening stream from string should be
modified according the correct syntax.
Incorrect syntax: fopen( "data://text/plain,[ Insert lengthy comment here.]",
"r");
Correct syntax, option #1: fopen("data:text/plain,".urlencode('[ Insert
lengthy comment here.]')."", "r");
Correct syntax, option #2: fopen("data:text/plain;base64,".base64_encode('[
Insert lengthy comment here.]')."", "r");
TEST CASE:
Just run this code in PHP:
Links:
PHP Data stream: http://php.net/manual/en/wrappers.data.php
RFC 2397: http://www.faqs.org/rfcs/rfc2397.html
Work Item Details
Original CodePlex Issue: Issue 19139
Status: Proposed
Reason Closed: Unassigned
Assigned to: Unassigned
Reported on: Nov 18, 2010 at 11:44 AM
Reported by: michalkocarek
Updated on: Nov 18, 2010 at 11:45 AM
Updated by: michalkocarek
The text was updated successfully, but these errors were encountered: