Skip to content

Commit d12f8d6

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
1 parent afba8b6 commit d12f8d6

23 files changed

+67
-1542
lines changed

UPGRADING

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ PHP X.Y UPGRADE NOTES
2121
========================================
2222

2323
- Drop Windows XP and 2003 support. (Pierre)
24+
- php_logo_guid(), php_egg_logo_guid(), php_real_logo_guid() and
25+
zend_logo_guid() have been removed
26+
- Removal of Logo GUIDs
2427

2528
========================================
2629
2. New Features
@@ -89,6 +92,8 @@ PHP X.Y UPGRADE NOTES
8992
- IntlDateFormatter::setTimeZoneID() and datefmt_set_timezone_id() are
9093
deprecated. Use IntlDateFormatter::setTimeZone() or datefmt_set_timezone()
9194
instead.
95+
- php_logo_guid(), php_egg_logo_guid(), php_real_logo_guid() and
96+
zend_logo_guid() have been removed
9297

9398
========================================
9499
5. New Functions
@@ -222,3 +227,5 @@ PHP X.Y UPGRADE NOTES
222227
========================================
223228
11. Other Changes
224229
========================================
230+
231+
- Logo GUIDs will no longer work

configure.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1443,7 +1443,7 @@ PHP_ADD_SOURCES(main, main.c snprintf.c spprintf.c php_sprintf.c \
14431443
fopen_wrappers.c alloca.c php_scandir.c \
14441444
php_ini.c SAPI.c rfc1867.c php_content_types.c strlcpy.c \
14451445
strlcat.c mergesort.c reentrancy.c php_variables.c php_ticks.c \
1446-
network.c php_open_temporary_file.c php_logos.c \
1446+
network.c php_open_temporary_file.c \
14471447
output.c getopt.c)
14481448

14491449
PHP_ADD_SOURCES(main/streams, streams.c cast.c memory.c filter.c \

ext/standard/basic_functions.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1550,18 +1550,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phpcredits, 0, 0, 0)
15501550
ZEND_ARG_INFO(0, flag)
15511551
ZEND_END_ARG_INFO()
15521552

1553-
ZEND_BEGIN_ARG_INFO(arginfo_php_logo_guid, 0)
1554-
ZEND_END_ARG_INFO()
1555-
1556-
ZEND_BEGIN_ARG_INFO(arginfo_php_real_logo_guid, 0)
1557-
ZEND_END_ARG_INFO()
1558-
1559-
ZEND_BEGIN_ARG_INFO(arginfo_php_egg_logo_guid, 0)
1560-
ZEND_END_ARG_INFO()
1561-
1562-
ZEND_BEGIN_ARG_INFO(arginfo_zend_logo_guid, 0)
1563-
ZEND_END_ARG_INFO()
1564-
15651553
ZEND_BEGIN_ARG_INFO(arginfo_php_sapi_name, 0)
15661554
ZEND_END_ARG_INFO()
15671555

@@ -2723,10 +2711,6 @@ const zend_function_entry basic_functions[] = { /* {{{ */
27232711
PHP_FE(phpinfo, arginfo_phpinfo)
27242712
PHP_FE(phpversion, arginfo_phpversion)
27252713
PHP_FE(phpcredits, arginfo_phpcredits)
2726-
PHP_FE(php_logo_guid, arginfo_php_logo_guid)
2727-
PHP_FE(php_real_logo_guid, arginfo_php_real_logo_guid)
2728-
PHP_FE(php_egg_logo_guid, arginfo_php_egg_logo_guid)
2729-
PHP_FE(zend_logo_guid, arginfo_zend_logo_guid)
27302714
PHP_FE(php_sapi_name, arginfo_php_sapi_name)
27312715
PHP_FE(php_uname, arginfo_php_uname)
27322716
PHP_FE(php_ini_scanned_files, arginfo_php_ini_scanned_files)

ext/standard/credits.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@
2727

2828
PHPAPI void php_print_credits(int flag TSRMLS_DC) /* {{{ */
2929
{
30-
if (!sapi_module.phpinfo_as_text && flag & PHP_CREDITS_FULLPAGE) {
31-
php_print_info_htmlhead(TSRMLS_C);
32-
}
33-
3430
if (!sapi_module.phpinfo_as_text) {
3531
PUTS("<h1>PHP Credits</h1>\n");
3632
} else {
@@ -123,10 +119,6 @@ PHPAPI void php_print_credits(int flag TSRMLS_DC) /* {{{ */
123119
CREDIT_LINE("Windows Infrastructure", "Alex Schoenmaker");
124120
php_info_print_table_end();
125121
}
126-
127-
if (!sapi_module.phpinfo_as_text && flag & PHP_CREDITS_FULLPAGE) {
128-
PUTS("</div></body></html>\n");
129-
}
130122
}
131123
/* }}} */
132124

ext/standard/info.c

Lines changed: 28 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,6 @@ static int php_info_printf(const char *fmt, ...) /* {{{ */
9292
}
9393
/* }}} */
9494

95-
static void php_info_print_request_uri(TSRMLS_D) /* {{{ */
96-
{
97-
if (SG(request_info).request_uri) {
98-
php_info_print_html_esc(SG(request_info).request_uri, strlen(SG(request_info).request_uri));
99-
}
100-
}
101-
/* }}} */
102-
10395
static int php_info_print(const char *str) /* {{{ */
10496
{
10597
TSRMLS_FETCH();
@@ -671,7 +663,6 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
671663
if (flag & PHP_INFO_GENERAL) {
672664
char *zend_version = get_zend_version();
673665
char temp_api[10];
674-
char *logo_guid;
675666

676667
php_uname = php_get_uname('a');
677668

@@ -680,13 +671,18 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
680671
}
681672

682673
if (expose_php && !sapi_module.phpinfo_as_text) {
683-
php_info_print("<a href=\"http://www.php.net/\"><img border=\"0\" src=\"");
684-
php_info_print_request_uri(TSRMLS_C);
685-
php_info_print("?=");
686-
logo_guid = php_logo_guid();
687-
php_info_print(logo_guid);
688-
efree(logo_guid);
689-
php_info_print("\" alt=\"PHP Logo\" /></a>");
674+
time_t the_time;
675+
struct tm *ta, tmbuf;
676+
677+
the_time = time(NULL);
678+
ta = php_localtime_r(&the_time, &tmbuf);
679+
680+
php_info_print("<a href=\"http://www.php.net/\"><img border=\"0\" src=\"");
681+
if (ta && (ta->tm_mon==3) && (ta->tm_mday==1)) {
682+
php_info_print(PHP_EGG_LOGO_DATA_URI "\" alt=\"PHP logo\" /></a>");
683+
} else {
684+
php_info_print(PHP_LOGO_DATA_URI "\" alt=\"PHP logo\" /></a>");
685+
}
690686
}
691687

692688
if (!sapi_module.phpinfo_as_text) {
@@ -789,8 +785,7 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
789785
php_info_print_box_start(0);
790786
if (expose_php && !sapi_module.phpinfo_as_text) {
791787
php_info_print("<a href=\"http://www.zend.com/\"><img border=\"0\" src=\"");
792-
php_info_print_request_uri(TSRMLS_C);
793-
php_info_print("?="ZEND_LOGO_GUID"\" alt=\"Zend logo\" /></a>\n");
788+
php_info_print(ZEND_LOGO_DATA_URI "\" alt=\"Zend logo\" /></a>\n");
794789
}
795790
php_info_print("This program makes use of the Zend Scripting Language Engine:");
796791
php_info_print(!sapi_module.phpinfo_as_text?"<br />":"\n");
@@ -805,11 +800,23 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
805800

806801
if ((flag & PHP_INFO_CREDITS) && expose_php && !sapi_module.phpinfo_as_text) {
807802
php_info_print_hr();
808-
php_info_print("<h1><a href=\"");
809-
php_info_print_request_uri(TSRMLS_C);
810-
php_info_print("?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000\">");
803+
php_info_print("<script>(function () {\n");
804+
php_info_print("'use strict';\n");
805+
php_info_print(" window.onload = function () {\n");
806+
php_info_print(" document.getElementById('credits').style.display = 'none';\n");
807+
php_info_print(" document.getElementById('revealcredits').style.display = 'block';\n");
808+
php_info_print(" document.getElementById('revealcredits').onclick = function () {\n");
809+
php_info_print(" document.getElementById('credits').style.display = 'block';\n");
810+
php_info_print(" document.getElementById('revealcredits').style.display = 'none';\n");
811+
php_info_print(" };\n");
812+
php_info_print(" };\n");
813+
php_info_print("}());</script>\n");
814+
php_info_print("<h1><a id=\"revealcredits\" href=\"#credits\" style=\"display: none;\">");
811815
php_info_print("PHP Credits");
812816
php_info_print("</a></h1>\n");
817+
php_info_print("<div id=\"credits\">\n");
818+
php_print_credits(PHP_CREDITS_ALL, TSRMLS_C);
819+
php_info_print("</div>\n");
813820
}
814821

815822
zend_ini_sort_entries(TSRMLS_C);
@@ -1191,77 +1198,6 @@ PHP_FUNCTION(phpcredits)
11911198
}
11921199
/* }}} */
11931200

1194-
/* {{{ php_logo_guid
1195-
*/
1196-
PHPAPI char *php_logo_guid(void)
1197-
{
1198-
char *logo_guid;
1199-
1200-
time_t the_time;
1201-
struct tm *ta, tmbuf;
1202-
1203-
the_time = time(NULL);
1204-
ta = php_localtime_r(&the_time, &tmbuf);
1205-
1206-
if (ta && (ta->tm_mon==3) && (ta->tm_mday==1)) {
1207-
logo_guid = PHP_EGG_LOGO_GUID;
1208-
} else {
1209-
logo_guid = PHP_LOGO_GUID;
1210-
}
1211-
1212-
return estrdup(logo_guid);
1213-
1214-
}
1215-
/* }}} */
1216-
1217-
/* {{{ proto string php_logo_guid(void)
1218-
Return the special ID used to request the PHP logo in phpinfo screens*/
1219-
PHP_FUNCTION(php_logo_guid)
1220-
{
1221-
if (zend_parse_parameters_none() == FAILURE) {
1222-
return;
1223-
}
1224-
1225-
RETURN_STRING(php_logo_guid(), 0);
1226-
}
1227-
/* }}} */
1228-
1229-
/* {{{ proto string php_real_logo_guid(void)
1230-
Return the special ID used to request the PHP logo in phpinfo screens*/
1231-
PHP_FUNCTION(php_real_logo_guid)
1232-
{
1233-
if (zend_parse_parameters_none() == FAILURE) {
1234-
return;
1235-
}
1236-
1237-
RETURN_STRINGL(PHP_LOGO_GUID, sizeof(PHP_LOGO_GUID)-1, 1);
1238-
}
1239-
/* }}} */
1240-
1241-
/* {{{ proto string php_egg_logo_guid(void)
1242-
Return the special ID used to request the PHP logo in phpinfo screens*/
1243-
PHP_FUNCTION(php_egg_logo_guid)
1244-
{
1245-
if (zend_parse_parameters_none() == FAILURE) {
1246-
return;
1247-
}
1248-
1249-
RETURN_STRINGL(PHP_EGG_LOGO_GUID, sizeof(PHP_EGG_LOGO_GUID)-1, 1);
1250-
}
1251-
/* }}} */
1252-
1253-
/* {{{ proto string zend_logo_guid(void)
1254-
Return the special ID used to request the Zend logo in phpinfo screens*/
1255-
PHP_FUNCTION(zend_logo_guid)
1256-
{
1257-
if (zend_parse_parameters_none() == FAILURE) {
1258-
return;
1259-
}
1260-
1261-
RETURN_STRINGL(ZEND_LOGO_GUID, sizeof(ZEND_LOGO_GUID)-1, 1);
1262-
}
1263-
/* }}} */
1264-
12651201
/* {{{ proto string php_sapi_name(void)
12661202
Return the current SAPI module name */
12671203
PHP_FUNCTION(php_sapi_name)

0 commit comments

Comments
 (0)