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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
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: Sat May 11 00:01:31 2024 UTC