mirror of
https://github.com/php/php-src.git
synced 2024-11-23 18:04:36 +08:00
Merge branch 'pull-request/132'
* pull-request/132: OK, bye bye JavaScript, let's just include credits before license Nicer (JSLint-compliant!) credits reveal JavaScript Removed now-unnecessary expose_php checks for logo Fixed small misalignment in prev commit Removed Logo GUIDs and replaced with Data URIs and div hidden with JS
This commit is contained in:
commit
c9eb64127e
@ -23,6 +23,9 @@ PHP X.Y UPGRADE NOTES
|
||||
- Drop Windows XP and 2003 support. (Pierre)
|
||||
- All internal case insensitivity handling for class, function and constant
|
||||
names is done according to ASCII rules, current locale settings are ignored.
|
||||
- php_logo_guid(), php_egg_logo_guid(), php_real_logo_guid() and
|
||||
zend_logo_guid() have been removed
|
||||
- Removal of Logo GUIDs
|
||||
|
||||
========================================
|
||||
2. New Features
|
||||
@ -94,6 +97,8 @@ PHP X.Y UPGRADE NOTES
|
||||
- IntlDateFormatter::format() and datefmt_format() now also accept an
|
||||
IntlCalendar object for formatting.
|
||||
- Deprecated mcrypt_ecb() made to produce E_DEPRECATED.
|
||||
- php_logo_guid(), php_egg_logo_guid(), php_real_logo_guid() and
|
||||
zend_logo_guid() have been removed
|
||||
|
||||
========================================
|
||||
5. New Functions
|
||||
@ -229,3 +234,5 @@ PHP X.Y UPGRADE NOTES
|
||||
========================================
|
||||
11. Other Changes
|
||||
========================================
|
||||
|
||||
- Logo GUIDs will no longer work
|
||||
|
@ -1443,7 +1443,7 @@ PHP_ADD_SOURCES(main, main.c snprintf.c spprintf.c php_sprintf.c \
|
||||
fopen_wrappers.c alloca.c php_scandir.c \
|
||||
php_ini.c SAPI.c rfc1867.c php_content_types.c strlcpy.c \
|
||||
strlcat.c mergesort.c reentrancy.c php_variables.c php_ticks.c \
|
||||
network.c php_open_temporary_file.c php_logos.c \
|
||||
network.c php_open_temporary_file.c \
|
||||
output.c getopt.c)
|
||||
|
||||
PHP_ADD_SOURCES(main/streams, streams.c cast.c memory.c filter.c \
|
||||
|
@ -1550,18 +1550,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phpcredits, 0, 0, 0)
|
||||
ZEND_ARG_INFO(0, flag)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO(arginfo_php_logo_guid, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO(arginfo_php_real_logo_guid, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO(arginfo_php_egg_logo_guid, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO(arginfo_zend_logo_guid, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
ZEND_BEGIN_ARG_INFO(arginfo_php_sapi_name, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
@ -2723,10 +2711,6 @@ const zend_function_entry basic_functions[] = { /* {{{ */
|
||||
PHP_FE(phpinfo, arginfo_phpinfo)
|
||||
PHP_FE(phpversion, arginfo_phpversion)
|
||||
PHP_FE(phpcredits, arginfo_phpcredits)
|
||||
PHP_FE(php_logo_guid, arginfo_php_logo_guid)
|
||||
PHP_FE(php_real_logo_guid, arginfo_php_real_logo_guid)
|
||||
PHP_FE(php_egg_logo_guid, arginfo_php_egg_logo_guid)
|
||||
PHP_FE(zend_logo_guid, arginfo_zend_logo_guid)
|
||||
PHP_FE(php_sapi_name, arginfo_php_sapi_name)
|
||||
PHP_FE(php_uname, arginfo_php_uname)
|
||||
PHP_FE(php_ini_scanned_files, arginfo_php_ini_scanned_files)
|
||||
|
@ -27,10 +27,6 @@
|
||||
|
||||
PHPAPI void php_print_credits(int flag TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
if (!sapi_module.phpinfo_as_text && flag & PHP_CREDITS_FULLPAGE) {
|
||||
php_print_info_htmlhead(TSRMLS_C);
|
||||
}
|
||||
|
||||
if (!sapi_module.phpinfo_as_text) {
|
||||
PUTS("<h1>PHP Credits</h1>\n");
|
||||
} else {
|
||||
@ -123,10 +119,6 @@ PHPAPI void php_print_credits(int flag TSRMLS_DC) /* {{{ */
|
||||
CREDIT_LINE("Windows Infrastructure", "Alex Schoenmaker");
|
||||
php_info_print_table_end();
|
||||
}
|
||||
|
||||
if (!sapi_module.phpinfo_as_text && flag & PHP_CREDITS_FULLPAGE) {
|
||||
PUTS("</div></body></html>\n");
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
@ -92,14 +92,6 @@ static int php_info_printf(const char *fmt, ...) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static void php_info_print_request_uri(TSRMLS_D) /* {{{ */
|
||||
{
|
||||
if (SG(request_info).request_uri) {
|
||||
php_info_print_html_esc(SG(request_info).request_uri, strlen(SG(request_info).request_uri));
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static int php_info_print(const char *str) /* {{{ */
|
||||
{
|
||||
TSRMLS_FETCH();
|
||||
@ -660,7 +652,6 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
|
||||
{
|
||||
char **env, *tmp1, *tmp2;
|
||||
char *php_uname;
|
||||
int expose_php = INI_INT("expose_php");
|
||||
|
||||
if (!sapi_module.phpinfo_as_text) {
|
||||
php_print_info_htmlhead(TSRMLS_C);
|
||||
@ -671,7 +662,6 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
|
||||
if (flag & PHP_INFO_GENERAL) {
|
||||
char *zend_version = get_zend_version();
|
||||
char temp_api[10];
|
||||
char *logo_guid;
|
||||
|
||||
php_uname = php_get_uname('a');
|
||||
|
||||
@ -679,14 +669,19 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
|
||||
php_info_print_box_start(1);
|
||||
}
|
||||
|
||||
if (expose_php && !sapi_module.phpinfo_as_text) {
|
||||
php_info_print("<a href=\"http://www.php.net/\"><img border=\"0\" src=\"");
|
||||
php_info_print_request_uri(TSRMLS_C);
|
||||
php_info_print("?=");
|
||||
logo_guid = php_logo_guid();
|
||||
php_info_print(logo_guid);
|
||||
efree(logo_guid);
|
||||
php_info_print("\" alt=\"PHP Logo\" /></a>");
|
||||
if (!sapi_module.phpinfo_as_text) {
|
||||
time_t the_time;
|
||||
struct tm *ta, tmbuf;
|
||||
|
||||
the_time = time(NULL);
|
||||
ta = php_localtime_r(&the_time, &tmbuf);
|
||||
|
||||
php_info_print("<a href=\"http://www.php.net/\"><img border=\"0\" src=\"");
|
||||
if (ta && (ta->tm_mon==3) && (ta->tm_mday==1)) {
|
||||
php_info_print(PHP_EGG_LOGO_DATA_URI "\" alt=\"PHP logo\" /></a>");
|
||||
} else {
|
||||
php_info_print(PHP_LOGO_DATA_URI "\" alt=\"PHP logo\" /></a>");
|
||||
}
|
||||
}
|
||||
|
||||
if (!sapi_module.phpinfo_as_text) {
|
||||
@ -787,10 +782,9 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
|
||||
|
||||
/* Zend Engine */
|
||||
php_info_print_box_start(0);
|
||||
if (expose_php && !sapi_module.phpinfo_as_text) {
|
||||
if (!sapi_module.phpinfo_as_text) {
|
||||
php_info_print("<a href=\"http://www.zend.com/\"><img border=\"0\" src=\"");
|
||||
php_info_print_request_uri(TSRMLS_C);
|
||||
php_info_print("?="ZEND_LOGO_GUID"\" alt=\"Zend logo\" /></a>\n");
|
||||
php_info_print(ZEND_LOGO_DATA_URI "\" alt=\"Zend logo\" /></a>\n");
|
||||
}
|
||||
php_info_print("This program makes use of the Zend Scripting Language Engine:");
|
||||
php_info_print(!sapi_module.phpinfo_as_text?"<br />":"\n");
|
||||
@ -803,15 +797,6 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
|
||||
efree(php_uname);
|
||||
}
|
||||
|
||||
if ((flag & PHP_INFO_CREDITS) && expose_php && !sapi_module.phpinfo_as_text) {
|
||||
php_info_print_hr();
|
||||
php_info_print("<h1><a href=\"");
|
||||
php_info_print_request_uri(TSRMLS_C);
|
||||
php_info_print("?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000\">");
|
||||
php_info_print("PHP Credits");
|
||||
php_info_print("</a></h1>\n");
|
||||
}
|
||||
|
||||
zend_ini_sort_entries(TSRMLS_C);
|
||||
|
||||
if (flag & PHP_INFO_CONFIGURATION) {
|
||||
@ -893,6 +878,12 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
|
||||
php_info_print_table_end();
|
||||
}
|
||||
|
||||
|
||||
if ((flag & PHP_INFO_CREDITS) && !sapi_module.phpinfo_as_text) {
|
||||
php_info_print_hr();
|
||||
php_print_credits(PHP_CREDITS_ALL TSRMLS_CC);
|
||||
}
|
||||
|
||||
if (flag & PHP_INFO_LICENSE) {
|
||||
if (!sapi_module.phpinfo_as_text) {
|
||||
SECTION("PHP License");
|
||||
@ -926,6 +917,7 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
|
||||
php_info_print("questions about PHP licensing, please contact license@php.net.\n");
|
||||
}
|
||||
}
|
||||
|
||||
if (!sapi_module.phpinfo_as_text) {
|
||||
php_info_print("</div></body></html>");
|
||||
}
|
||||
@ -1191,77 +1183,6 @@ PHP_FUNCTION(phpcredits)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ php_logo_guid
|
||||
*/
|
||||
PHPAPI char *php_logo_guid(void)
|
||||
{
|
||||
char *logo_guid;
|
||||
|
||||
time_t the_time;
|
||||
struct tm *ta, tmbuf;
|
||||
|
||||
the_time = time(NULL);
|
||||
ta = php_localtime_r(&the_time, &tmbuf);
|
||||
|
||||
if (ta && (ta->tm_mon==3) && (ta->tm_mday==1)) {
|
||||
logo_guid = PHP_EGG_LOGO_GUID;
|
||||
} else {
|
||||
logo_guid = PHP_LOGO_GUID;
|
||||
}
|
||||
|
||||
return estrdup(logo_guid);
|
||||
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto string php_logo_guid(void)
|
||||
Return the special ID used to request the PHP logo in phpinfo screens*/
|
||||
PHP_FUNCTION(php_logo_guid)
|
||||
{
|
||||
if (zend_parse_parameters_none() == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
RETURN_STRING(php_logo_guid(), 0);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto string php_real_logo_guid(void)
|
||||
Return the special ID used to request the PHP logo in phpinfo screens*/
|
||||
PHP_FUNCTION(php_real_logo_guid)
|
||||
{
|
||||
if (zend_parse_parameters_none() == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
RETURN_STRINGL(PHP_LOGO_GUID, sizeof(PHP_LOGO_GUID)-1, 1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto string php_egg_logo_guid(void)
|
||||
Return the special ID used to request the PHP logo in phpinfo screens*/
|
||||
PHP_FUNCTION(php_egg_logo_guid)
|
||||
{
|
||||
if (zend_parse_parameters_none() == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
RETURN_STRINGL(PHP_EGG_LOGO_GUID, sizeof(PHP_EGG_LOGO_GUID)-1, 1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto string zend_logo_guid(void)
|
||||
Return the special ID used to request the Zend logo in phpinfo screens*/
|
||||
PHP_FUNCTION(zend_logo_guid)
|
||||
{
|
||||
if (zend_parse_parameters_none() == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
RETURN_STRINGL(ZEND_LOGO_GUID, sizeof(ZEND_LOGO_GUID)-1, 1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto string php_sapi_name(void)
|
||||
Return the current SAPI module name */
|
||||
PHP_FUNCTION(php_sapi_name)
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
Check the output of the php_logo_guid() function
|
||||
--CREDITS--
|
||||
Sebastian Schürmann
|
||||
sschuermann@chip.de
|
||||
Testfest 2009 Munich
|
||||
--FILE--
|
||||
<?php
|
||||
echo php_logo_guid();
|
||||
?>
|
||||
--EXPECT--
|
||||
PHPE9568F34-D428-11d2-A769-00AA001ACF42
|
||||
|
@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
Testing the undocumented function php_real_logo_guid()
|
||||
--CREDITS--
|
||||
Sebastian Schürmann
|
||||
sschuermann@chip.de
|
||||
Testfest 2009 Munich
|
||||
--FILE--
|
||||
<?php
|
||||
echo php_real_logo_guid();
|
||||
?>
|
||||
--EXPECT--
|
||||
PHPE9568F34-D428-11d2-A769-00AA001ACF42
|
@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
Checking the zend_logo_guid() function
|
||||
--CREDITS--
|
||||
Sebastian Schürmann
|
||||
sschuermann@chip.de
|
||||
Testfest 2009 Munich
|
||||
--FILE--
|
||||
<?php
|
||||
echo zend_logo_guid();
|
||||
?>
|
||||
--EXPECT--
|
||||
PHPE9568F35-D428-11d2-A769-00AA001ACF42
|
1080
main/logos.h
1080
main/logos.h
File diff suppressed because it is too large
Load Diff
14
main/main.c
14
main/main.c
@ -86,7 +86,6 @@
|
||||
|
||||
#include "php_content_types.h"
|
||||
#include "php_ticks.h"
|
||||
#include "php_logos.h"
|
||||
#include "php_streams.h"
|
||||
#include "php_open_temporary_file.h"
|
||||
|
||||
@ -2157,14 +2156,6 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
/* initialize registry for images to be used in phpinfo()
|
||||
(this uses configuration parameters from php.ini)
|
||||
*/
|
||||
if (php_init_info_logos() == FAILURE) {
|
||||
php_printf("PHP: Unable to initialize info phpinfo logos.\n");
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
zuv.html_errors = 1;
|
||||
zuv.import_use_extension = ".php";
|
||||
php_startup_auto_globals(TSRMLS_C);
|
||||
@ -2348,7 +2339,6 @@ void php_module_shutdown(TSRMLS_D)
|
||||
/* Destroys filter & transport registries too */
|
||||
php_shutdown_stream_wrappers(module_number TSRMLS_CC);
|
||||
|
||||
php_shutdown_info_logos();
|
||||
UNREGISTER_INI_ENTRIES();
|
||||
|
||||
/* close down the ini config */
|
||||
@ -2396,10 +2386,6 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC)
|
||||
int retval = 0;
|
||||
|
||||
EG(exit_status) = 0;
|
||||
if (php_handle_special_queries(TSRMLS_C)) {
|
||||
zend_file_handle_dtor(primary_file TSRMLS_CC);
|
||||
return 0;
|
||||
}
|
||||
#ifndef HAVE_BROKEN_GETCWD
|
||||
# define OLD_CWD_SIZE 4096
|
||||
old_cwd = do_alloca(OLD_CWD_SIZE, use_heap);
|
||||
|
@ -1,99 +0,0 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.php.net/license/3_01.txt |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Author: Hartmut Holzgraefe <hholzgra@php.net> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#include "php.h"
|
||||
#include "logos.h"
|
||||
#include "php_logos.h"
|
||||
#include "ext/standard/info.h"
|
||||
#include "SAPI.h"
|
||||
|
||||
typedef struct _php_info_logo {
|
||||
const char *mimetype;
|
||||
int mimelen;
|
||||
const unsigned char *data;
|
||||
int size;
|
||||
} php_info_logo;
|
||||
|
||||
static HashTable phpinfo_logo_hash;
|
||||
|
||||
PHPAPI int php_register_info_logo(char *logo_string, const char *mimetype, const unsigned char *data, int size)
|
||||
{
|
||||
php_info_logo info_logo;
|
||||
|
||||
info_logo.mimetype = mimetype;
|
||||
info_logo.mimelen = strlen(mimetype);
|
||||
info_logo.data = data;
|
||||
info_logo.size = size;
|
||||
|
||||
return zend_hash_add(&phpinfo_logo_hash, logo_string, strlen(logo_string), &info_logo, sizeof(php_info_logo), NULL);
|
||||
}
|
||||
|
||||
PHPAPI int php_unregister_info_logo(char *logo_string)
|
||||
{
|
||||
return zend_hash_del(&phpinfo_logo_hash, logo_string, strlen(logo_string));
|
||||
}
|
||||
|
||||
int php_init_info_logos(void)
|
||||
{
|
||||
if(zend_hash_init(&phpinfo_logo_hash, 0, NULL, NULL, 1)==FAILURE)
|
||||
return FAILURE;
|
||||
|
||||
php_register_info_logo(PHP_LOGO_GUID , "image/gif", php_logo , sizeof(php_logo));
|
||||
php_register_info_logo(PHP_EGG_LOGO_GUID, "image/gif", php_egg_logo, sizeof(php_egg_logo));
|
||||
php_register_info_logo(ZEND_LOGO_GUID , "image/gif", zend_logo , sizeof(zend_logo));
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
int php_shutdown_info_logos(void)
|
||||
{
|
||||
zend_hash_destroy(&phpinfo_logo_hash);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
#define CONTENT_TYPE_HEADER "Content-Type: "
|
||||
int php_info_logos(const char *logo_string TSRMLS_DC)
|
||||
{
|
||||
php_info_logo *logo_image;
|
||||
char *content_header;
|
||||
int len;
|
||||
|
||||
if(FAILURE==zend_hash_find(&phpinfo_logo_hash, (char *) logo_string, strlen(logo_string), (void **)&logo_image))
|
||||
return 0;
|
||||
|
||||
len = sizeof(CONTENT_TYPE_HEADER) - 1 + logo_image->mimelen;
|
||||
content_header = emalloc(len + 1);
|
||||
memcpy(content_header, CONTENT_TYPE_HEADER, sizeof(CONTENT_TYPE_HEADER) - 1);
|
||||
memcpy(content_header + sizeof(CONTENT_TYPE_HEADER) - 1 , logo_image->mimetype, logo_image->mimelen);
|
||||
content_header[len] = '\0';
|
||||
sapi_add_header(content_header, len, 0);
|
||||
|
||||
PHPWRITE((char*)logo_image->data, logo_image->size);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
* vim600: sw=4 ts=4 fdm=marker
|
||||
* vim<600: sw=4 ts=4
|
||||
*/
|
@ -1,34 +0,0 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2012 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.01 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.php.net/license/3_01.txt |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Author: |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
|
||||
#ifndef _PHP_LOGOS_H
|
||||
#define _PHP_LOGOS_H
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
PHPAPI int php_register_info_logo(char *logo_string, const char *mimetype, const unsigned char *data, int size);
|
||||
PHPAPI int php_unregister_info_logo(char *logo_string);
|
||||
END_EXTERN_C()
|
||||
|
||||
int php_init_info_logos(void);
|
||||
int php_shutdown_info_logos(void);
|
||||
int php_info_logos(const char *logo_string TSRMLS_DC);
|
||||
|
||||
#endif /* _PHP_LOGOS_H */
|
@ -27,7 +27,6 @@
|
||||
#include "php_globals.h"
|
||||
#include "php_content_types.h"
|
||||
#include "SAPI.h"
|
||||
#include "php_logos.h"
|
||||
#include "zend_globals.h"
|
||||
|
||||
/* for systems that need to override reading of environment variables */
|
||||
@ -532,22 +531,6 @@ static void php_build_argv(char *s, zval *track_vars_array TSRMLS_DC)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ php_handle_special_queries
|
||||
*/
|
||||
PHPAPI int php_handle_special_queries(TSRMLS_D)
|
||||
{
|
||||
if (PG(expose_php) && SG(request_info).query_string && SG(request_info).query_string[0] == '=') {
|
||||
if (php_info_logos(SG(request_info).query_string + 1 TSRMLS_CC)) {
|
||||
return 1;
|
||||
} else if (!strcmp(SG(request_info).query_string + 1, PHP_CREDITS_GUID)) {
|
||||
php_print_credits(PHP_CREDITS_ALL TSRMLS_CC);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ php_register_server_variables
|
||||
*/
|
||||
static inline void php_register_server_variables(TSRMLS_D)
|
||||
|
@ -1948,40 +1948,38 @@ static int php_cli_server_request_shutdown(php_cli_server *server, php_cli_serve
|
||||
static int php_cli_server_dispatch_router(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
int decline = 0;
|
||||
if (!php_handle_special_queries(TSRMLS_C)) {
|
||||
zend_file_handle zfd;
|
||||
char *old_cwd;
|
||||
zend_file_handle zfd;
|
||||
char *old_cwd;
|
||||
|
||||
ALLOCA_FLAG(use_heap)
|
||||
old_cwd = do_alloca(MAXPATHLEN, use_heap);
|
||||
old_cwd[0] = '\0';
|
||||
php_ignore_value(VCWD_GETCWD(old_cwd, MAXPATHLEN - 1));
|
||||
ALLOCA_FLAG(use_heap)
|
||||
old_cwd = do_alloca(MAXPATHLEN, use_heap);
|
||||
old_cwd[0] = '\0';
|
||||
php_ignore_value(VCWD_GETCWD(old_cwd, MAXPATHLEN - 1));
|
||||
|
||||
zfd.type = ZEND_HANDLE_FILENAME;
|
||||
zfd.filename = server->router;
|
||||
zfd.handle.fp = NULL;
|
||||
zfd.free_filename = 0;
|
||||
zfd.opened_path = NULL;
|
||||
zfd.type = ZEND_HANDLE_FILENAME;
|
||||
zfd.filename = server->router;
|
||||
zfd.handle.fp = NULL;
|
||||
zfd.free_filename = 0;
|
||||
zfd.opened_path = NULL;
|
||||
|
||||
zend_try {
|
||||
zval *retval = NULL;
|
||||
if (SUCCESS == zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, &retval, 1, &zfd)) {
|
||||
if (retval) {
|
||||
decline = Z_TYPE_P(retval) == IS_BOOL && !Z_LVAL_P(retval);
|
||||
zval_ptr_dtor(&retval);
|
||||
}
|
||||
} else {
|
||||
decline = 1;
|
||||
zend_try {
|
||||
zval *retval = NULL;
|
||||
if (SUCCESS == zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, &retval, 1, &zfd)) {
|
||||
if (retval) {
|
||||
decline = Z_TYPE_P(retval) == IS_BOOL && !Z_LVAL_P(retval);
|
||||
zval_ptr_dtor(&retval);
|
||||
}
|
||||
} zend_end_try();
|
||||
|
||||
if (old_cwd[0] != '\0') {
|
||||
php_ignore_value(VCWD_CHDIR(old_cwd));
|
||||
} else {
|
||||
decline = 1;
|
||||
}
|
||||
} zend_end_try();
|
||||
|
||||
free_alloca(old_cwd, use_heap);
|
||||
if (old_cwd[0] != '\0') {
|
||||
php_ignore_value(VCWD_CHDIR(old_cwd));
|
||||
}
|
||||
|
||||
free_alloca(old_cwd, use_heap);
|
||||
|
||||
return decline;
|
||||
}
|
||||
/* }}} */
|
||||
|
@ -1,41 +0,0 @@
|
||||
--TEST--
|
||||
Bug #60180 ($_SERVER["PHP_SELF"] incorrect)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
include "skipif.inc";
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
include "php_cli_server.inc";
|
||||
php_cli_server_start('sytanx error;', TRUE);
|
||||
|
||||
list($host, $port) = explode(':', PHP_CLI_SERVER_ADDRESS);
|
||||
$port = intval($port)?:80;
|
||||
|
||||
$fp = fsockopen($host, $port, $errno, $errstr, 0.5);
|
||||
if (!$fp) {
|
||||
die("connect failed");
|
||||
}
|
||||
|
||||
$logo_id = php_logo_guid();
|
||||
|
||||
if(fwrite($fp, <<<HEADER
|
||||
GET /?={$logo_id} HTTP/1.1
|
||||
Host: {$host}
|
||||
|
||||
|
||||
HEADER
|
||||
)) {
|
||||
while (!feof($fp)) {
|
||||
if (("Content-Type: image/gif") == trim(fgets($fp))) {
|
||||
echo "okey";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fclose($fp);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
okey
|
@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
Testing php_egg_logo_guid() function
|
||||
--FILE--
|
||||
<?php
|
||||
echo php_egg_logo_guid();
|
||||
?>
|
||||
--EXPECT--
|
||||
PHPE9568F36-D428-11d2-A769-00AA001ACF42
|
||||
|
||||
--CREDITS--
|
||||
Jason Easter <easter@phpug-wuerzburg.de>
|
||||
PHPUG Würzburg <phpug-wuerzburg.de>
|
||||
Testfest 2009 2009-06-20
|
@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
Testing php_logo_guid() function
|
||||
--FILE--
|
||||
<?php
|
||||
echo php_logo_guid();
|
||||
?>
|
||||
--EXPECT--
|
||||
PHPE9568F34-D428-11d2-A769-00AA001ACF42
|
||||
--CREDITS--
|
||||
Testfest 2009 2009-06-20
|
@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
Testing php_real_logo_guid() function
|
||||
--FILE--
|
||||
<?php
|
||||
echo php_real_logo_guid();
|
||||
?>
|
||||
--EXPECT--
|
||||
PHPE9568F34-D428-11d2-A769-00AA001ACF42
|
||||
--CREDITS--
|
||||
Jason Easter <easter@phpug-wuerzburg.de>
|
||||
PHPUG Würzburg <phpug-wuerzburg.de>
|
||||
Testfest 2009 2009-06-20
|
@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
Testing zend_logo_guid() function
|
||||
--FILE--
|
||||
<?php
|
||||
echo zend_logo_guid();
|
||||
?>
|
||||
--EXPECT--
|
||||
PHPE9568F35-D428-11d2-A769-00AA001ACF42
|
||||
|
||||
--CREDITS--
|
||||
Jason Easter <easter@phpug-wuerzburg.de>
|
||||
PHPUG Würzburg <phpug-wuerzburg.de>
|
||||
Testfest 2009 2009-06-20
|
@ -368,7 +368,7 @@ if (VCVERS == 1200) {
|
||||
ADD_SOURCES("main", "main.c snprintf.c spprintf.c getopt.c fopen_wrappers.c \
|
||||
php_scandir.c php_ini.c SAPI.c rfc1867.c php_content_types.c strlcpy.c \
|
||||
strlcat.c mergesort.c reentrancy.c php_variables.c php_ticks.c network.c \
|
||||
php_open_temporary_file.c php_logos.c output.c internal_functions.c php_sprintf.c");
|
||||
php_open_temporary_file.c output.c internal_functions.c php_sprintf.c");
|
||||
ADD_SOURCES("win32", "inet.c fnmatch.c sockets.c");
|
||||
|
||||
// Newer versions have it
|
||||
|
@ -164,10 +164,6 @@ SOURCE=..\main\php_ini.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\main\php_logos.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\main\php_open_temporary_file.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@ -288,10 +284,6 @@ SOURCE=..\main\php_ini.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\main\php_logos.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\main\php_open_temporary_file.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
@ -201,10 +201,6 @@ SOURCE=..\main\php_ini.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\main\php_logos.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\main\php_open_temporary_file.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@ -317,10 +313,6 @@ SOURCE=..\main\php_ini.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\main\php_logos.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\main\php_main.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
Loading…
Reference in New Issue
Block a user