Skip to content

Instantly share code, notes, and snippets.

View mattbrundage's full-sized avatar

Matt Brundage mattbrundage

View GitHub Profile
@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;
}
@mattbrundage
mattbrundage / index.cfm
Last active October 25, 2024 16:04
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>
main {
margin-inline: auto;
max-width: 64ch;