function ad_cache_file_variables in Advertisement 6.3
Same name and namespace in other branches
- 5.2 cache/file/ad_cache_file.inc \ad_cache_file_variables()
- 5 cache/file/ad_cache_file.inc \ad_cache_file_variables()
- 6 cache/file/ad_cache_file.inc \ad_cache_file_variables()
- 6.2 cache/file/ad_cache_file.inc \ad_cache_file_variables()
- 7 cache/file/ad_cache_file.inc \ad_cache_file_variables()
Additional variables required by the filecache.
File
- cache/
file/ ad_cache_file.inc, line 345 - A plug in for the ad.module, providing a file cache mechanism for improved performance when displaying ads.
Code
function ad_cache_file_variables() {
// paths are comprised of alphanumerics, underscores, dashes, periods and
// slashes.
$variables = array();
$variables['path'] = isset($_GET['p']) ? preg_replace('/[^_\\-\\.\\/\\0-9a-zA-Z]/', '', $_GET['p']) : 'files';
// files is an integer.
$variables['files'] = isset($_GET['f']) ? (int) $_GET['f'] : 1;
if ($variables['files'] > 15) {
echo "Invalid value 'f=" . $variables['files'] . "', exiting.<br />\n";
exit;
}
return $variables;
}