WordPress.org

Ready to get started?Download WordPress

Forums

Bad REQUEST_URI not corrected under some IIS7 configs (1 post)

  1. Alexandre
    Member
    Posted 2 years ago #

    In some IIS7 configurations, the REQUEST_URI value is not correct (without query string) but the wp_fix_server_vars function doesn't correct it because php_sapi_name function returns 'cgi-fcgi'!

    To correct this bug, wp_fix_server_vars function should contain:
    if (!empty($_SERVER['QUERY_STRING']) && !strpos($_SERVER['REQUEST_URI'], '?', 0))
    $_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];

    Dump of $_SERVER var:
    SERVER_SOFTWARE=Microsoft-IIS/7.5
    REQUEST_URI=/index.php
    _FCGI_X_PIPE_=\\.\pipe\IISFCGI-f5ef931d-f5a9-4ae3-9f07-c523a695bd33
    ALLUSERSPROFILE=C:\ProgramData
    APPDATA=C:\Windows\system32\config\systemprofile\AppData\Roaming
    APP_POOL_CONFIG=C:\inetpub\temp\apppools\SP0.x86.Net4.0\SP0.x86.Net4.0.config
    APP_POOL_ID=SP0.x86.Net4.0
    CommonProgramFiles=C:\Program Files (x86)\Common Files
    CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
    CommonProgramW6432=C:\Program Files\Common Files
    COMPUTERNAME=WL36
    ComSpec=C:\Windows\system32\cmd.exe
    FP_NO_HOST_CHECK=NO
    LOCALAPPDATA=C:\Windows\system32\config\systemprofile\AppData\Local
    NUMBER_OF_PROCESSORS=4
    OS=Windows_NT
    Path=C:\Perl\site\bin;C:\Perl\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ExchangeMapi\;C:\Tools\dll\shibboleth-sp\bin\;C:\Tools\dll\shibboleth-sp\lib\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;
    PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
    PROCESSOR_ARCHITECTURE=x86
    PROCESSOR_ARCHITEW6432=AMD64
    PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 44 Stepping 2, GenuineIntel
    PROCESSOR_LEVEL=6
    PROCESSOR_REVISION=2c02
    ProgramData=C:\ProgramData
    ProgramFiles=C:\Program Files (x86)
    ProgramFiles(x86)=C:\Program Files (x86)
    ProgramW6432=C:\Program Files
    PSModulePath=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
    PUBLIC=C:\Users\Public
    SHIBSP_PREFIX=c:/Tools/dll/shibboleth-sp
    SHIBSP_SCHEMAS=C:\Tools\dll\shibboleth-sp\share\xml\shibboleth\catalog.xml;C:\Tools\dll\shibboleth-sp\share\xml\xmltooling\catalog.xml;C:\Tools\dll\shibboleth-sp\share\xml\opensaml\saml20-catalog.xml;C:\Tools\dll\shibboleth-sp\share\xml\opensaml\saml11-catalog.xml
    SystemDrive=C:
    SystemRoot=C:\Windows
    TEMP=c:\temp
    TMP=c:\temp
    USERDOMAIN=WEBLAND
    USERNAME=WL36$
    USERPROFILE=C:\Windows\system32\config\systemprofile
    windir=C:\Windows
    FCGI_ROLE=RESPONDER
    HTTP_CACHE_CONTROL=max-age=0
    HTTP_CONNECTION=keep-alive
    HTTP_CONTENT_LENGTH=0
    HTTP_ACCEPT=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    HTTP_ACCEPT_ENCODING=gzip, deflate
    HTTP_ACCEPT_LANGUAGE=fr-fr
    HTTP_COOKIE=wp-settings-1=editor%3Dhtml%26hidetb%3D1; wp-settings-time-1=1339323159; PHPSESSID=32tl96nkg5hmqjljruub6hmg83; wordpress_logged_in_d32aeaf956ae4de93f76b54f7a70a95b=admin%7C1339494132%7C0c75072f2032cf6d36447a191382dd46; wordpress_test_cookie=WP+Cookie+check; __utma=95421598.382239911.1338963302.1338963302.1339321324.2; __utmc=95421598; __utmz=95421598.1338963302.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)
    HTTP_HOST=www.swissoceanservices.com
    HTTP_USER_AGENT=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2
    HTTP_X_REQUEST_URI=/index.php
    HTTP_X_REWRITE_URL=/index.php
    HTTP_ORIGINAL_URL=/index.php
    PHP_VER=5
    IIS_UrlRewriteModule=7.1.0871.0
    APPL_MD_PATH=/LM/W3SVC/208/ROOT
    APPL_PHYSICAL_PATH=d:\www\www208\
    AUTH_TYPE=
    AUTH_PASSWORD=
    AUTH_USER=
    CERT_COOKIE=
    CERT_FLAGS=
    CERT_ISSUER=
    CERT_SERIALNUMBER=
    CERT_SUBJECT=
    CONTENT_LENGTH=0
    CONTENT_TYPE=
    DOCUMENT_ROOT=d:/www/www208
    GATEWAY_INTERFACE=CGI/1.1
    HTTPS=off
    HTTPS_KEYSIZE=
    HTTPS_SECRETKEYSIZE=
    HTTPS_SERVER_ISSUER=
    HTTPS_SERVER_SUBJECT=
    INSTANCE_ID=208
    INSTANCE_NAME=WWW208
    INSTANCE_META_PATH=/LM/W3SVC/208
    LOCAL_ADDR=92.43.216.136
    LOGON_USER=
    PATH_TRANSLATED=d:\www\www208\index.php
    QUERY_STRING=page_id=20
    REMOTE_ADDR=88.209.93.213
    REMOTE_HOST=88.209.93.213
    REMOTE_PORT=56147
    REMOTE_USER=
    REQUEST_METHOD=GET
    SCRIPT_FILENAME=d:\www\www208\index.php
    SCRIPT_NAME=/index.php
    SERVER_NAME=www.swissoceanservices.com
    SERVER_PORT=80
    SERVER_PORT_SECURE=0
    SERVER_PROTOCOL=HTTP/1.1
    URL=/index.php
    ORIG_PATH_INFO=/index.php
    PHP_SELF=/index.php
    REQUEST_TIME=1339363070

Topic Closed

This topic has been closed to new replies.

About this Topic