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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: tom at r dot je
New email:
PHP Version: OS:

 

 [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-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 11:01:27 2024 UTC