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 August 12, 2024 17:08
cfdump XSS demo
<!doctype html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<title>&lt;cfdump&gt; is not vulnerable to XSS</title>
<style>
main {
margin-inline: auto;
max-width: 800px;
@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;
}