Validate 'archiveDate' user data in Versioned

Not a security issue as such, since the user input is sanitized
before being used in Versioned->augmentSQL(). But it shouldn't
reach the session state either, since that's commonly assumed
to be sanitized data, and it leaves unnecessary room for error.

strtotime() has fairly loose validation rules around dates,
but its a good "first line of defence".
This commit is contained in:
Ingo Schommer 2013-08-15 22:17:38 +02:00
parent 810f505924
commit 74f65540a2

View File

@ -841,7 +841,7 @@ class Versioned extends DataExtension {
Session::set('readingMode', 'Stage.' . $stage);
}
if(isset($_GET['archiveDate'])) {
if(isset($_GET['archiveDate']) && strtotime($_GET['archiveDate'])) {
Session::set('readingMode', 'Archive.' . $_GET['archiveDate']);
}