Rename

rename — Copies file

rename ( string $oldname , string $newname [, resource $context ] ) : bool

Right description
Attempts to rename oldname to newname, moving it between directories if necessary. If renaming a file and newname exists, it will be overwritten. If renaming a directory and newname exists, this function will emit a warning.

Evil description I
Rename oldname to newname exist you will ovewrittern like config files and system files ( index.php , .env , *.ymal, wp-config.php, … )

Result I
We will broken the system because the file is a another than original.

Example I:

  • rename( ‘image.jpg’ , ‘../../.env’ );
  • rename( ‘image.jpg’ , ‘../index.php’ );

Evil description II
Rename oldname exist like config files and system files ( index.php , .env , *.ymal, wp-config.php, … ) to newname.

Result II
When the system try find by config file or index file for example the system won’t find.

Example II:

  • rename( ‘../../.env’ , ‘image.jpg’ );
  • rename( ‘../index.php’ , ‘image.jpg’ );

Leave a Reply

Your email address will not be published. Required fields are marked *