Skip to content
This repository has been archived by the owner on Aug 28, 2019. It is now read-only.

Commit

Permalink
Support for PHP older than 5.2.0.
Browse files Browse the repository at this point in the history
Thank you Jonte for notifying.
  • Loading branch information
tuupola committed Mar 30, 2009
1 parent 99884ca commit 48e0202
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions AssetsController.php
Expand Up @@ -230,6 +230,11 @@ function assets_latest($limit = 0, $folder='assets') {
/* Do not include thumbnails. */
if (!strpos($file, '.64c.')) {
$path_parts = pathinfo($file);
/* Support for PHP older than 5.2.0 */
if (empty($path_parts['filename'])) {
$path_parts['filename'] = basename($file, '.' . $path_parts['extension']);
}

$folder = str_replace($_SERVER['DOCUMENT_ROOT'], '', $path_parts['dirname']) . '/';
$original = $folder . $path_parts['basename'];
if (assets_is_image($path_parts['extension'])) {
Expand Down

0 comments on commit 48e0202

Please sign in to comment.