Skip to content

getFullPageHtml() and reading cookies to find session id

Latest
Compare
Choose a tag to compare
@spaze spaze released this 16 May 00:17
· 2 commits to main since this release
f8e76c3
  • Read $_COOKIE[session_name()] directly to find session id if session is not active (#13)

Previously, only the output from session_id() was sanitized, but session has to be started for the function to return anything. So now the cookie is also read directly, and I'd still recommend you explicitly add the string with something like addSanitization($this0>sessionHandler->getId(), '[***]') which is now mentioned in the README too.

  • Add getFullPageHtml() (#14)

getFullPageHtml() doesn't remove HEAD & BODY and preserve inline styles while still sanitizing what it's supposed to be sanitized. The method was added to make using this package easier in a simple pages like the old school /info.php with just <?php phpinfo();

The README now also warns that using getHtml() removes the HEAD element with the meta name="ROBOTS" tag, so you should somehow add it back. That's also why getFullPageHtml() was added.