Skip to content

Instantly share code, notes, and snippets.

View mattbrundage's full-sized avatar

Matt Brundage mattbrundage

View GitHub Profile
@mattbrundage
mattbrundage / index.cfm
Last active February 21, 2025 14:13
cfdump XSS demo
<!doctype html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<title>&lt;cfdump&gt; is not vulnerable to XSS in its default configuration</title>
<style>
html { color-scheme: light dark; }
body {
@mattbrundage
mattbrundage / assetQueryString.php
Created May 7, 2012 18:42
Determines the file modification date and whether or not to append a query string to the file path
function assetQueryString ($filePath, $maxAge = 7) {
$today = intval(strtotime(date("Y-m-d")) / 86400);
$fileDate = intval(strtotime(date("Y-m-d", filemtime($_SERVER['DOCUMENT_ROOT'].$filePath))) / 86400);
$days = $today - $fileDate;
if ($days <= $maxAge) {
$filePath .= "?".$fileDate;
}
echo $filePath;
}