Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 5 commits into from
Aug 6, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -222,3 +227,5 @@ PHP X.Y UPGRADE NOTES
========================================
11. Other Changes
========================================

- Logo GUIDs will no longer work
2 changes: 1 addition & 1 deletion configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
16 changes: 0 additions & 16 deletions ext/standard/basic_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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)
Expand Down
8 changes: 0 additions & 8 deletions ext/standard/credits.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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");
}
}
/* }}} */

Expand Down
123 changes: 22 additions & 101 deletions ext/standard/info.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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);
Expand All @@ -671,22 +662,26 @@ 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');

if (!sapi_module.phpinfo_as_text) {
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) {
Expand Down Expand Up @@ -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");
Expand All @@ -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) {
Expand Down Expand Up @@ -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_C);
}

if (flag & PHP_INFO_LICENSE) {
if (!sapi_module.phpinfo_as_text) {
SECTION("PHP License");
Expand Down Expand Up @@ -926,6 +917,7 @@ PHPAPI void php_print_info(int flag TSRMLS_DC)
php_info_print("questions about PHP licensing, please contact [email protected].\n");
}
}

if (!sapi_module.phpinfo_as_text) {
php_info_print("</div></body></html>");
}
Expand Down Expand Up @@ -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)
Expand Down
Loading