php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58262 anything in php tags is stripped when using ssh2.sftp
Submitted: 2008-07-02 11:22 UTC Modified: 2008-12-20 12:29 UTC
From: tom at r dot je Assigned:
Status: Not a bug Package: ssh2 (PECL)
PHP Version: 5.2.5 OS: Debian
Private report: No CVE-ID: None
 [2008-07-02 11:22 UTC] tom at r dot je
Description:
------------
When using sftp via fread(), anything between php tags is removed from the output.



Reproduce code:
---------------
test.php:

one
<?
echo 'two';
?>
three

$stream = fopen("ssh2.sftp://$sftp$file", 'r');
echo filesize("ssh2.sftp://$sftp$file"); //CORRECT.
echo fread($stream, filesize("ssh2.sftp://$sftp$file")); // prints "onethree"


Expected result:
----------------
The entire contents of the file.

Actual result:
--------------
Contents of  the file without anything in between <? and ?>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-12-20 12:29 UTC] mikesul@php.net
Please ensure that your are escaping your output properly based on the view you're using (ie, use htmlspecialchars). When outputting as HTML, you won't see things inside PHP tags.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Sep 20 09:01:26 2019 UTC