Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP::Include did not handle comments #7139

Closed
p5pRT opened this issue Feb 27, 2004 · 5 comments
Closed

PHP::Include did not handle comments #7139

p5pRT opened this issue Feb 27, 2004 · 5 comments

Comments

@p5pRT
Copy link

p5pRT commented Feb 27, 2004

Migrated from rt.perl.org#27187 (status was 'resolved')

Searchable as RT27187$

@p5pRT
Copy link
Author

p5pRT commented Feb 27, 2004

From ajs@ajs.com

Created by ajs@ajs.com

PHP​::Include did not handle comments or arrays with
(questionable, but still valid) trailing commas. I've got a patch​:

Inline Patch
--- PHP-Include-0.07.orig/lib/PHP/Include/Vars.pm       2003-11-14 17:39:20.000000000 -0500
+++ PHP-Include-0.07/lib/PHP/Include/Vars.pm    2004-02-27 16:20:20.000000000 -0500
@@ -5,13 +5,21 @@
 use Parse::RecDescent;
 use Data::Dumper;
  
+               $::RD_HINT = 1;
+               $::RD_TRACE = undef;
+               $::RD_WARN = 1;
+               $::RD_ERRORS = 1;
+
+
 our $perl = '';
 my $grammar =
  
  
 <<'GRAMMAR';
  
-php_vars:      php_start assignment(s) php_end
+php_vars:      php_start statement(s) php_end
+
+statement:     /\#.*/ | assignment
  
 php_start:     /\s*<\?php\s*/
  
@@ -27,13 +35,13 @@
                    $return = "my $item[1]=$item[3]";
                }
  
-hash_assign:   variable /=/ /Array\s*\(/ pair(s /,/) /\s*\)/
+hash_assign:   variable /=/ /Array\s*\(/i pair(s /,/) /\s*(,\s*)?\)/
                {
                    $item[1] =~ s/^\$/%/;
                    $return = "my $item[1]=(" . join( ',', @{$item[4]} ) . ')';
                }
  
-array_assign:  variable /=/ /Array\s*\(/ element(s /,/) /\s*\)/
+array_assign:  variable /=/ /Array\s*\(/i element(s /,/) /\s*\)/
                {
                    $item[1] =~ s/^\$/@/;
                    $return = "my $item[1]=(" . join( ',', @{$item[4]} ) . ')'
Perl Info

Flags:
    category=library
    severity=low

Site configuration information for perl v5.6.1:

Configured by bhcompile at Mon Aug 18 16:07:35 EDT 2003.

Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
  Platform:
    osname=linux, osvers=2.4.21-1.1931.2.393.entsmp, archname=i386-linux
    uname='linux bugs.devel.redhat.com 2.4.21-1.1931.2.393.entsmp #1 smp thu aug 14 14:47:21 edt 2003 i686 unknown '
    config_args='-des -Doptimize=-O2 -march=i386 -mcpu=i686 -Dcc=gcc -Dcf_by=Red Hat, Inc. -Dcccdlflags=-fPIC -Dinstallprefix=/usr -Dprefix=/usr -Darchname=i386-linux -Dvendorprefix=/usr -Dsiteprefix=/usr -Uusethreads -Uuseithreads -Uuselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db -Di_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Dinc_version_list=5.6.0/i386-linux 5.6.0'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=undef usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
  Compiler:
    cc='gcc', ccflags ='-fno-strict-aliasing -I/usr/local/include',
    optimize='-O2 -march=i386 -mcpu=i686',
    cppflags='-fno-strict-aliasing -I/usr/local/include'
    ccversion='', gccversion='2.96 20000731 (Red Hat Linux 7.3 2.96-113)', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=4
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -ldl -lm -lc -lcrypt -lutil
    perllibs=-lnsl -ldl -lm -lc -lcrypt -lutil
    libc=/lib/libc-2.2.5.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:
    


@INC for perl v5.6.1:
    /usr/lib/perl5/5.6.1/i386-linux
    /usr/lib/perl5/5.6.1
    /usr/lib/perl5/site_perl/5.6.1/i386-linux
    /usr/lib/perl5/site_perl/5.6.1
    /usr/lib/perl5/site_perl/5.6.0
    /usr/lib/perl5/site_perl
    /usr/lib/perl5/vendor_perl/5.6.1/i386-linux
    /usr/lib/perl5/vendor_perl/5.6.1
    /usr/lib/perl5/vendor_perl
    .


Environment for perl v5.6.1:
    HOME=/home/ajs
    LANG=C
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/home/ajs/bin
    PERL_BADLANG (unset)
    SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Feb 29, 2004

From @rspier

This bug should be reported to bug-php-include@​rt.cpan.org

@p5pRT
Copy link
Author

p5pRT commented Feb 29, 2004

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Feb 29, 2004

@rspier - Status changed from 'open' to 'resolved'

@p5pRT p5pRT closed this as completed Feb 29, 2004
@p5pRT
Copy link
Author

p5pRT commented Feb 29, 2004

From @schwern

On Fri, Feb 27, 2004 at 09​:34​:50PM -0000, Aaron Sherman wrote​:

PHP​::Include did not handle comments or arrays with
(questionable, but still valid) trailing commas. I've got a patch​:

This patch should go to the author of PHP​::Include, Ed Summers.
esummers@​cpan.org.

--
Michael G Schwern schwern@​pobox.com http​://www.pobox.com/~schwern/
Operation Bitter Jungle Cat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant