php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14832 basename with 2nd parm corrupts source string
Submitted: 2002-01-03 15:01 UTC Modified: 2002-01-03 15:21 UTC
From: pascal at vmfacility dot fr Assigned:
Status: Closed Package: Directory function related
PHP Version: 4.1.0 OS: Linux 2.4.8-26mdk i686
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: pascal at vmfacility dot fr
New email:
PHP Version: OS:

 

 [2002-01-03 15:01 UTC] pascal at vmfacility dot fr
<?php
$fn="/dir1/dir2/filename.txt";
$basename=basename($fn, ".txt");
echo "basename=$basename\n";
echo "fn after=$fn\n";
?>

X-Powered-By: PHP/4.1.0
Content-type: text/html; charset=iso-8859-15

basename=filename
fn after=/dir1/dir2/filenametxt

$fn ha been corrupted by basename() call.


'./configure' '--disable-static' '--disable-debug' '--disable-rpath' '--enable-pic' '--enable-inline-optimization' '--prefix=/usr' '--with-zlib' '--with-config-file-path=/etc' '--enable-magic-quotes' '--enable-debugger' '--enable-track-vars' '--enable-safe-mode' '--with-exec-dir=/usr/bin' '--with-regex=system' '--with-versioning' '--enable-sysvsem' '--enable-sysvshm' '--with-mod_charset' '--enable-force-cgi-redirect' '--with-mm' '--enable-trans-sid' '--with-dbase' '--with-filepro' '--enable-yp' '--enable-ftp' '--with-xml' '--with-gettext' <br>[Some modules are external: look for packages php-pgsql,php-mysql,...]

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-03 15:20 UTC] hholzgra@php.net
fixed in CVS
 [2002-01-03 15:21 UTC] hholzgra@php.net
forgot to close
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Apr 28 22:01:29 2025 UTC