<?php // force UTF-8// Ø list($album, $image) = rewrite_get_album_image('album', 'image'); $folders = explode('/', $album); if (array_key_exists(0, $folders) && $folders[0] == CACHEFOLDER) { // a failed reference to a cached image? require_once SERVERPATH . '/' . ZENFOLDER . '/admin-functions.php'; require_once SERVERPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/cacheManager/functions.php'; unset($folders[0]); list($image, $args) = getImageProcessorURIFromCacheName(implode('/', $folders) . '/' . $image, getWatermarks()); if (file_exists(getAlbumFolder() . $image)) { $uri = getImageURI($args, dirname($image), basename($image), NULL); header("HTTP/1.0 302 Found"); header("Status: 302 Found"); header('Location: ' . $uri); exitZP(); } } if (isset($_GET['fromlogout'])) { header("HTTP/1.0 302 Found"); header("Status: 302 Found"); header('Location: ' . WEBPATH . '/index.php'); exitZP(); } $obj = @$_zp_gallery_page; $_zp_gallery_page = '404.php'; if (isset($_index_theme)) { $_zp_script = SERVERPATH . "/" . THEMEFOLDER . '/' . internalToFilesystem($_index_theme) . '/404.php'; } else { $_zp_script = NULL;
} } } } } } $sql = 'SELECT * FROM ' . prefix($table) . ' WHERE `' . $field . '` REGEXP "<img.*src\\s*=\\s*\\".*' . CACHEFOLDER . '((\\.|[^\\"])*)"'; $result = query($sql); if ($result) { while ($row = db_fetch_assoc($result)) { preg_match_all('~\\<img.*src\\s*=\\s*"((\\.|[^"])*)~', $row[$field], $matches); foreach ($matches[1] as $key => $match) { $updated = false; if (preg_match('~/' . CACHEFOLDER . '/~', $match)) { $found++; list($image, $args) = getImageProcessorURIFromCacheName($match, $watermarks); $try = $_zp_supported_images; $base = stripSuffix($image); $prime = getSuffix($image); array_unshift($try, $prime); $try = array_unique($try); $missing = true; //see if we can match the cache name to an image in the album. //Note that the cache suffix may not match the image suffix foreach ($try as $suffix) { if (file_exists(getAlbumFolder() . $base . '.' . $suffix)) { $missing = false; $image = $base . '.' . $suffix; $uri = getImageURI($args, dirname($image), basename($image), NULL); if (strpos($uri, 'i.php?') !== false) { $fixed++;