Category: General

2011-08-22

Bug in PHP 5.3.7, Recommended that We Wait for 5.3.8

by Charles — Categories: General, PHP — Tags: , , 1 Comment

Due to a bug in crypt(), PHP.net is recommending that you not updgrade to PHP version 5.3.7, but instead wait for 5.3.8 to be released.

Description:
------------
If crypt() is executed with MD5 salts, the return value conists of the salt only.
DES and BLOWFISH salts work as expected.

2011-08-18

PHP 5.3.7 Released, 5.2.x No Longer Supported

by Charles — Categories: General, PHP — Tags: , , 2 Comments

UPDATE 2011-08-22: See this post about a bug in crypt() in 5.3.7. PHP.net is recommending that you not upgrade to 5.3.7, but instead wait for 5.3.8.

PHP.net announced today that PHP version 5.3.7 has been released. I’m not sure if this is old news or not, but I also saw in the announcement that “all PHP users should note that the PHP 5.2 series is NOT supported anymore. All users are strongly encouraged to upgrade to PHP 5.3.7.” The major fixes/enhancements are:

Security Enhancements and Fixes in PHP 5.3.7:

  • Updated crypt_blowfish to 1.2. (CVE-2011-2483)
  • Fixed crash in error_log(). Reported by Mateusz Kocielski
  • Fixed buffer overflow on overlog salt in crypt().
  • Fixed bug #54939 (File path injection vulnerability in RFC1867 File upload filename). Reported by Krzysztof Kotowicz. (CVE-2011-2202)
  • Fixed stack buffer overflow in socket_connect(). (CVE-2011-1938)
  • Fixed bug #54238 (use-after-free in substr_replace()). (CVE-2011-1148)

Key enhancements in PHP 5.3.7 include:

  • Upgraded bundled Sqlite3 to version 3.7.7.1
  • Upgraded bundled PCRE to version 8.12
  • Fixed bug #54910 (Crash when calling call_user_func with unknown function name)
  • Fixed bug #54585 (track_errors causes segfault)
  • Fixed bug #54262 (Crash when assigning value to a dimension in a non-array)
  • Fixed a crash inside dtor for error handling
  • Fixed bug #55339 (Segfault with allow_call_time_pass_reference = Off)
  • Fixed bug #54935 php_win_err can lead to crash
  • Fixed bug #54332 (Crash in zend_mm_check_ptr // Heap corruption)
  • Fixed bug #54305 (Crash in gc_remove_zval_from_buffer)
  • Fixed bug #54580 (get_browser() segmentation fault when browscap ini directive is set through php_admin_value)
  • Fixed bug #54529 (SAPI crashes on apache_config.c:197)
  • Fixed bug #54283 (new DatePeriod(NULL) causes crash).
  • Fixed bug #54269 (Short exception message buffer causes crash)
  • Fixed Bug #54221 (mysqli::get_warnings segfault when used in multi queries)
  • Fixed bug #54395 (Phar::mount() crashes when calling with wrong parameters)
  • Fixed bug #54384 (Dual iterators, GlobIterator, SplFileObject and SplTempFileObject crash when user-space classes don’t call the parent constructor)
  • Fixed bug #54292 (Wrong parameter causes crash in SplFileObject::__construct())
  • Fixed bug #54291 (Crash iterating DirectoryIterator for dir name starting with \0)
  • Fixed bug #54281 (Crash in non-initialized RecursiveIteratorIterator)
  • Fixed bug #54623 (Segfault when writing to a persistent socket after closing a copy of the socket)
  • Fixed bug #54681 (addGlob() crashes on invalid flags)
  • Over 80 other bug fixes.

2010-03-21

Good News / Bad News

by Charles — Categories: General, PHP — Tags: , 1 Comment

The good news: PHP has lots and lots of useful built-in functions for all sorts of things.

The bad news: PHP has lots and lots of useful built-in functions I don’t know about.

Sometimes it’s almost an embarrassment of riches. You think you know PHP pretty well and know how to write some pretty slick code. In a thread at PHPBuilder.com I threw together a bit of code to build a CSV file from a database query. I figured I was being fairly clever using the uniqid() function to create a unique file name I could use for temporary storage of the CSV data, fopen()-ing it and then eventually using readfile() to output it to the user, followed by an unlink() of the file once it’s done.

Then fellow moderator “Weedpacket” pointed out to me the tmpfile() function, which I’d never run into before, and which makes it easy to open up a temporary file. It returns a file handle similarly to the fopen() function. The nice part is that you do not have to worry at all about generating a unique name, and the file is automatically deleted upon script completion (or when you fclose() it should you choose to).

It serves as a slightly humbling reminder that when working with PHP, before you write code to do something that someone else has likely had to do in the past, it is probably worth your while to scan through the function lists of applicable sections of the manual to see if there is already a built-in function which does what you need. It is often worth the time to make that search, as the built-in functions are likely to be faster than your own user-defined functions, plus hopefully they should be more robust.

2010-03-14

Tourney Time Again

by Charles — Categories: General — Tags: , Leave a comment

I’ve posted my 2010 NCAA Men’s Basketball Tournament randomized bracket generator. It’s a quick way to pick winners for your bracket pools. It simply weights each game by the teams’ tournament seedings. It ain’t fancy, but if you’re tired of spending hours trying to pick the winners only to find you’re out of the competition by the first Friday, well, this way at least you won’t have wasted as much time.

2009-11-10

Amazon Kindle for PC

by Charles — Categories: GeneralLeave a comment

Amazon.com has just released a beta version of Kindle for PC. This free application allows you to purchase and read Amazon Kindle e-books on your PC. If you also own their Kindle reader, the application will sync with your existing account, making any e-books purchased through Amazon available both on your PC and your Kindle.

I just downloaded and installed it on my Windows 7 notebook PC, and everything seems to be working fine. The interface is pretty simple and straight-forward, and the syncing with my existing Kindle reader account appeared to work seamlessly. If you’ve been considering whether or not to purchase a Kindle, this could be a good way for you to investigate the availability of reading materials. If you’re already a Kindle owner, this could be useful for situations where it may be more convenient to read a book at your PC — such as your favorite PHP books, perhaps? (There, I made this post have something to do with PHP.)

2009-09-17

Komodo Edit 5.2.0 Released

by Charles — Categories: General, PHP — Tags: , , , Leave a comment

Download Komodo Edit 5.2.0

The 5.2.0 version of Komodo Edit has just been released. In addition to some bug fixes and UI features, the release notes indicate that support for PHP 5.3.0 has been added, including code completions for name spaces and syntax coloring of latest keywords (“namespace”, “use”, “as”, etc…).

(FYI, this is the editor I’m currently using, but who knows which I’ll be using a few months from now.)

2009-09-16

Book List Application

by Charles — Categories: General, PHP — Tags: , , 1 Comment

As something I’m doing just because I want to and as a learning experience, I’m in the beginning stages of creating a web application where users can manage data on books: books they own, books they’ve read, and books they want to read. Assuming I stick with it, I figure I’ll post occasional articles here on the progress; hopefully providing some useful information on some of the issues I encounter as well as showing how my warped mind approaches such a task.

I started thinking about this a week or two ago, and posted a thread at KindleBoards.com to get some feedback on what sort of features people might like. I’m still in the process of deciding which suggestions to embrace and which to ignore. In the meantime I’ve started to forge ahead on the database design. I find that if I get the database structure right, then the rest falls into place much more easily — as opposed to making the database design fit my application code. My first major snag is trying to figure out how to deal with the fact that book titles are not unique (titles cannot be copyrighted). For details on that issue, I just started a thread at PHPBuilder.com, hoping some database expert will have a magical solution for me.

About the only firm decision at this point is that the app will be built upon the CodeIgniter framework, simply because I’m used to it, and it works. I’ve done some preliminary layout work for the front end, and have been making progress on using the Amazon.com Product Advertising API to (hopefully) provide a simple means for users to add books to their lists via a simple drag-and-drop of a URL from an Amazon web page. Unfortunately for us Amazon Kindle users, the Amazon database is currently not playing nice with Kindle books, so for now it’s limited to print book pages.

More to come soon, I hope….

© 2012 PHP Musings All rights reserved - Wallow theme v0.46.4 by ([][]) TwoBeers - Powered by WordPress - Have fun!