Permalink
Browse files

Removed Logo GUIDs and replaced with Data URIs and div hidden with JS

- removed php_logo_guid()
- removed php_egg_logo_guid()
- removed php_real_logo_guid()
- removed zend_logo_guid()
- removed logo GUID handling
- removed logo GUIDs from source
- added logo data URIs instead for phpinfo()
- added credits to phpinfo() page, but hidden by default
  • Loading branch information...
1 parent afba8b6 commit d12f8d67903e2c9775a0f2b647a9c29d61e02261 @TazeTSchnitzel TazeTSchnitzel committed Jul 14, 2012
View
@@ -21,6 +21,9 @@ PHP X.Y UPGRADE NOTES
========================================
- Drop Windows XP and 2003 support. (Pierre)
+- 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
@@ -89,6 +92,8 @@ PHP X.Y UPGRADE NOTES
- IntlDateFormatter::setTimeZoneID() and datefmt_set_timezone_id() are
deprecated. Use IntlDateFormatter::setTimeZone() or datefmt_set_timezone()
instead.
+- php_logo_guid(), php_egg_logo_guid(), php_real_logo_guid() and
+ zend_logo_guid() have been removed
========================================
5. New Functions
@@ -222,3 +227,5 @@ PHP X.Y UPGRADE NOTES
========================================
11. Other Changes
========================================
+
+- Logo GUIDs will no longer work
View
@@ -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");
- }
}
/* }}} */
View
@@ -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();
@@ -671,7 +663,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');
@@ -680,13 +671,18 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
}
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>");
+ 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) {
@@ -789,8 +785,7 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
php_info_print_box_start(0);
if (expose_php && !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");
@@ -805,11 +800,23 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
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("<script>(function () {\n");
+ php_info_print("'use strict';\n");
+ php_info_print(" window.onload = function () {\n");
+ php_info_print(" document.getElementById('credits').style.display = 'none';\n");
+ php_info_print(" document.getElementById('revealcredits').style.display = 'block';\n");
+ php_info_print(" document.getElementById('revealcredits').onclick = function () {\n");
+ php_info_print(" document.getElementById('credits').style.display = 'block';\n");
+ php_info_print(" document.getElementById('revealcredits').style.display = 'none';\n");
+ php_info_print(" };\n");
+ php_info_print(" };\n");
+ php_info_print("}());</script>\n");
+ php_info_print("<h1><a id=\"revealcredits\" href=\"#credits\" style=\"display: none;\">");
php_info_print("PHP Credits");
php_info_print("</a></h1>\n");
+ php_info_print("<div id=\"credits\">\n");
+ php_print_credits(PHP_CREDITS_ALL, TSRMLS_C);
+ php_info_print("</div>\n");
}
zend_ini_sort_entries(TSRMLS_C);
@@ -1191,77 +1198,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)
Oops, something went wrong.

0 comments on commit d12f8d6

Please sign in to comment.