Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > PHP: Общие вопросы > PHP 5.2.1


Автор: Mal Hack 9.2.2007, 22:10
http://news.php.net/php.announce/65

Цитата

The PHP development team would like to announce the immediate  
availability of PHP 5.2.1. This release is a major stability and  
security enhancement of the 5.X branch, and all users are strongly  
encouraged to upgrade to it as soon as possible.

Security Enhancements and Fixes in PHP 5.2.1:

* Fixed possible safe_mode & open_basedir bypasses inside the session  
extension.
* Prevent searchs engine from indexing the phpinfo() page.
* Fixed a number of input processing bugs inside the filter extension.
* Fixed unserialize() abuse on 64 bit systems with certain input  
strings.
* Fixed possible overflows and stack corruptions in the session  
extension.
* Fixed an underflow inside the internal sapi_header_op() function.
* Fixed allocation bugs caused by attempts to allocate negative  
values in some code paths.
* Fixed possible stack overflows inside zip, imap & sqlite extensions.
* Fixed several possible buffer overflows inside the stream filters.
* Fixed non-validated resource destruction inside the shmop extension.
* Fixed a possible overflow in the str_replace() function.
* Fixed possible clobbering of super-globals in several code paths.
* Fixed a possible information disclosure inside the wddx extension.
* Fixed a possible string format vulnerability in *print() functions  
on 64 bit systems.
* Fixed a possible buffer overflow inside mail() and ibase_ 
{delete,add,modify}_user() functions.
* Fixed a string format vulnerability inside the odbc_result_all()  
function.
* Memory limit is now enabled by default.
* Added internal heap protection.
* Extended filter extension support for $_SERVER in CGI and apache2  
SAPIs.
The majority of the security vulnerabilities discovered and resolved  
can in most cases be only abused by local users and cannot be  
triggered remotely. However, some of the above issues can be  
triggered remotely in certain situations, or exploited by malicious  
local users on shared hosting setups utilizing PHP as an Apache  
module. Therefore, we strongly advise all users of PHP, regardless of  
the version to upgrade to 5.2.1 release as soon as possible. PHP  
4.4.5 with equivalent security corrections will be available shortly.


The key improvements of PHP 5.2.1 include:

* Several performance improvements in the engine, streams API and  
some Windows specific optimizations.
* PDO_MySQL now uses buffered queries by default and emulates  
prepared statements to bypass
 limitations of MySQL's prepared  
statement API.
* Many improvements and enhancements to the filter and zip extensions.
* Memory limit is now always enabled, this includes Windows builds,  
with a default limit of 128 megabytes.
* Added several performance optimizations using faster Win32 APIs  
(this change means that PHP no longer supports Windows 98).
* FastCGI speed optimized build of PHP for Windows made available for  
downloading.
* Over 180 bug fixes.
For users upgrading from PHP 5.0 and PHP 5.1, an upgrade guide is  
available at http://www.php.net/UPDATE_5_2.txt, detailing the changes  
between those releases and PHP 5.2.1.

For a full list of changes in PHP 5.2.1, see the ChangeLog (http:// 
www.php.net/ChangeLog-5.php#5.2.1).


Часть языковых новшеств:
Цитата

# Added CURLOPT_TCP_NODELAY constant to Curl extension. (Sara)
# Added support for hex numbers of any size. (Matt)
# Added function stream_socket_shutdown(). It is a wrapper for system shutdown() function, that shut downs part of a full-duplex connection. (Dmitry)
# Added internal heap protection (Dmitry)

    * memory-limit is always enabled (--enable-memory-limit removed)
    * default value if memory-limit is set to 128M
    * safe unlinking
    * cookies
    * canary protection (debug build only)
    * random generation of cookies and canaries

# Added forward support for 'b' prefix in front of string literals. (Andrei)
# Added three new functions to ext/xmlwriter (Rob, Ilia)

    * xmlwriter_start_dtd_entity()
    * xmlwriter_end_dtd_entity()
    * xmlwriter_write_dtd_entity()

# Added a meta tag to phpinfo() output to prevent search engines from indexing the page. (Ilia)
# Added new function, sys_get_temp_dir(). (Hartmut)
# Added missing object support to file_put_contents(). (Ilia)
# Added support for md2, ripemd256 and ripemd320 algos to hash(). (Sara)
# Added forward support for (binary) cast. (Derick)
# Added optimization for imageline with horizontal and vertical lines (Pierre)
# Removed dependency from SHELL32.DLL. (Dmitry)
# Removed double "wrong parameter count" warnings in various functions. (Hannes)
# Moved extensions to PECL:

    * ext/informix (Derick, Tony)

# Changed double-to-string utilities to use BSD implementation. (Dmitry, Tony)
# Updated bundled libcURL to version 7.16.0 in the Windows distro. (Edin)
# Updated timezone database to version 2006.16. (Derick)
# cgi.* and fastcgi.* directives are moved to INI subsystem. The new directive cgi.check_shebang_line can be used to omitting check for "#! /usr/bin/php" line. (Dmitry).
# Improved proc_open(). Now on Windows it can run external commands not through CMD.EXE. (Dmitry)
# VCWD_REALPATH() is improved to use realpath cache without VIRTUAL_DIR. (Dmitry)
# ext/bcmath initialization code is moved from request startup to module startup. (Dmitry)
# Zend Memory Manager Improvements (Dmitry)

    * use HeapAlloc() instead of VirtualAlloc()
    * use "win32" storage manager (instead of "malloc") on Windows by default

# Zip Extension Improvements (Pierre)

    * Fixed leak in statName and stateIndex
    * Fixed return setComment (Hannes)
    * Added addEmptyDir method

# Filter Extension Improvements (Ilia, Pierre)

    * Fixed a bug when callback function returns a non-modified value.
    * Added filter support for $_SERVER in cgi/apache2 sapis.
    * Make sure PHP_SELF is filtered in Apache 1 sapi.
    * Fixed bug #39358 (INSTALL_HEADERS contains incorrect reference to php_filter.h).
    * Added "default" option that allows a default value to be set for an invalid or missing value.
    * Invalid filters fails instead of returning unsafe value
    * Fixed possible double encoding problem with sanitizing filters
    * Make use of space-strict strip_tags() function
    * Fixed whitespace trimming
    * Added support for FastCGI environment variables. (Dmitry)

Автор: Opik 11.2.2007, 20:53
А смысл? smile

Автор: Mal Hack 11.2.2007, 21:09
Чтоб знали, что есть нового...  smile 

Автор: Master_ 11.3.2007, 10:21
А что насчет защищенных кукисов? Как этот параметр называется и есть ли где о нем информация?

Автор: Mal Hack 11.3.2007, 16:32
Цитата(Master_ @  11.3.2007,  10:21 Найти цитируемый пост)
А что насчет защищенных кукисов? Как этот параметр называется и есть ли где о нем информация? 

Это ты о чем?

Автор: GZep 13.5.2007, 20:53
Master_, защищенные кукисы - это кукисы которые передаются только при защищенном соединении. (может я ошибаюсь)

Автор: reich 11.8.2007, 12:51
А в php5 уже нельзя использовать конструкцию <?=funct()?>             ???
если
function funct()
{
    $var="Привет";
    return $var;
}

В php4 такое работало...
щас я поставил пятый, не работает. работает только так: <?php echo(funct()); ?>

Автор: reich 11.8.2007, 15:51
Извините за флуд. Я уже разобрался.
Если у кого-то такая же проблема, то найдите в php.ini строку 
Код
short_open_tag = Off
 
и замените ее на 
Код
short_open_tag = On

Автор: kamaikin 6.9.2007, 10:53
Цитата(reich @ 11.8.2007,  15:51)
Извините за флуд. Я уже разобрался.
Если у кого-то такая же проблема, то найдите в php.ini строку 
Код
short_open_tag = Off
 
и замените ее на 
Код
short_open_tag = On

Может быть мое мнение не очень авторитетно... Не уверен, что стоит включать короткие теги. По сообщениям разработчиков в дальнейшем они собираются полностью убрать поддержку коротких тегов из php.

Автор: console 14.9.2007, 02:00
К коротким тегам привыкать не стоит. Проблемы будут возникать при работе с xml.

Автор: Acer 16.9.2007, 21:35
Во вставках пхп в хтмл удобнее использовать короткие теги... Но вот проблема только в одном. По умолчанию директива short_open_tag отключена...
например вот такая ситуация:
есть функция, которая возвращает строку. Эту строку надо показать юзеру. если использовать короткие теги можно сделать так:
Код

<h2><?=ftext('title');?></h2>

А если не использовать короткие теги, то надо писать вот так
Код

<h2><?php echo ftext('title'); ?></h2>

Я думаю, что первый вариант удобнее, но лучше никогда не использовать short_open_tag

Автор: madFobos 27.12.2007, 13:48
Цитата(console @  14.9.2007,  02:00 Найти цитируемый пост)
К коротким тегам привыкать не стоит. Проблемы будут возникать при работе с xml. 


Да ну? И какие? Вы же не будете сувать вывод XML непосредственно в PHP скрипт? А если он будет отдельным XML файлом, то там уже никаких проблем... Плюс всегда можно сделать echo "", если нужно использовать <?... А что касательно самих коротких тэгов, то они намного удобнее и я 5 лет програмлю, используя именно короткие тэги (причем с XML сто раз работал из PHP), и нигде из-за этого проблем не было... Я даже когда качал PHP 5.2.x у них там в php.ini короткие тэги включены...

Цитата(kamaikin @  6.9.2007,  10:53 Найти цитируемый пост)
Может быть мое мнение не очень авторитетно... Не уверен, что стоит включать короткие теги. По сообщениям разработчиков в дальнейшем они собираются полностью убрать поддержку коротких тегов из php. 


Смысл? Если можно сделать этот параметр настраиваемым... Вряд ли они уберут, иначе совместимости не будет никакой.

Автор: nerezus 29.8.2009, 18:28
Цитата

К коротким тегам привыкать не стоит. Проблемы будут возникать при работе с xml.
 гггг)
Не надо писать код-винигрет, вот и проблем не возникнет )

Пора бы и открепить тему)

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)