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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
48 + 36 = ?
Subscribe to this entry?

 
 [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 13:01:28 2024 UTC