#18151 [Opn->Csd]: Comments not being stripped.

From: Date: Sun, 15 Sep 2002 23:02:32 +0000
Subject: #18151 [Opn->Csd]: Comments not being stripped.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-19417@lists.php.net to get a copy of this message
ID: 18151 Updated by: iliaa@php.net -Summary: include_path allows bypass of safe_mode Reported By: polone@townnews.com -Status: Open +Status: Closed Bug Type: Scripting Engine problem Operating System: Linux 2.4.18 PHP Version: 4.2.0 New Comment: This bug has been fixed in CVS. In case this was a PHP problem, snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites in short time. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2002-07-04 03:59:14] sander@php.net No, the CLI (and possibly the CGI too) is programmed to ignore the first line of a script if it starts with #. Anyway, php -w (latest CVS) doesn't strip comments, although it's supposed to. (ab)using this report for that issue. ------------------------------------------------------------------------ [2002-07-03 17:50:30] polone@townnews.com The php -w option also strips comments outside of the PHP tags. Thus, a program like: #!/usr/bin/php -q <?php // Bye-Bye comment print "hello world\n"; ?> Would end up like: <?php print "hello world\n"; ?> But, this is incorrect. It should be: #!/usr/bin/php -q <?php print "hello world\n"; ?> It appears this only happens if the first line in the file is formatted like a PHP comment. Thus, # This is not a PHP comment!!!! <?php print "hello world\n"; ?> Also strips the "# This is not a PHP comment!!!!". Regards, Patrick O'Lone INN/TownNews.com polone@townnews.com ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=18151&edit=1

« previous php.bugs (#19417) next »