php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71736 Conditional META HTTP-EQUIV output unconditionally
Submitted: 2016-03-08 01:51 UTC Modified: -
From: dlc dot usa at gmail dot com Assigned:
Status: Open Package: Scripting Engine problem
PHP Version: 5.6.19 OS: CRUX 3.2
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2016-03-08 01:51 UTC] dlc dot usa at gmail dot com
Description:
------------
name=php
version=5.6.19
release=1
source=(http://php.net/distributions/php-$version.tar.xz)

build () {
    cd php-$version

    local PHP_CONFIG="
    --prefix=/usr --mandir=/usr/share/man \
    --with-config-file-path=/etc/php \
    --with-config-file-scan-dir=/etc/php/conf.d \
    --with-zlib \
    --with-pcre-regex=/usr \
    --disable-static --disable-debug \
    --without-sqlite3 --without-pdo-sqlite \
    --without-pear"

    local PHP_SHARED="
    --enable-dba=shared --with-gdbm --with-db4 \
    --with-bz2=shared \
    --with-curl=shared \
    --with-openssl=shared \
    --enable-zip=shared \
    --enable-mbstring=shared"

    EXTENSION_DIR=/usr/lib/php/extensions \
    ./configure \
        $PHP_CONFIG \
        $PHP_SHARED \
        --enable-cli \
        --disable-cgi \
        --with-readline

    make
    make -j1 INSTALL_ROOT=$PKG install
    rm $PKG/usr/lib/php/extensions/*.a
    ln -sf phar.phar $PKG/usr/bin/phar

    sed -i '/^extension_dir/s|=.*$|= "/usr/lib/php/extensions"|' php.ini-*
    install -d $PKG/etc/php/conf.d
    install -m 644 php.ini-* $PKG/etc/php

    # order matters !
    printf 'extension=%s\n' {zip,bz2,curl,openssl,dba,mbstring}.so \
           > $PKG/etc/php/conf.d/extensions.ini
}


Test script:
---------------
Fails (works in 5.6.15); i.e., the engine does the echo/exit regardless of variable values:

// If all is good and the user wants to go to the home page, do it
if ( $bsi == 'y' && $vgo == 'h' )
{ echo '<META HTTP-EQUIV=Refresh CONTENT="1;URL=DLC_Home.php?mwb=' . $mwb . '">' ;
  exit ;
} ?>

Changing the "META" above to "ME' . 'TA" as below works in both releases:

// If all is good and the user wants to go to the home page, do it
if ( $bsi == 'y' && $vgo == 'h' )
{ echo '<ME' . 'TA HTTP-EQUIV=Refresh CONTENT="1;URL=DLC_Home.php?mwb=' . $mwb . '">' ;
  exit ;
} ?>

Expected result:
----------------
The original code should behave in 5.6.19 as it does in 5.6.15.

Actual result:
--------------
The refresh to the HTTP-EQUIV URL occurs (but because the original page was not properly processed due to the processing short-circuit, the refreshed page is defective).

Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri May 24 03:01:26 2019 UTC