public function FppWithPanelsTest::testAdminTitleXss in Fieldable Panels Panes (FPP) 7
Make sure admin titles with XSS code can't break the site.
File
- tests/
fpp.with_panels.test, line 121 - Tests for the Fieldable Panels Panes module with Panels.
Class
- FppWithPanelsTest
- Tests for the Fieldable Panels Panes module with Panels.
Code
public function testAdminTitleXss() {
// Create an FPP with an XSS payload in the admin title.
$fpp = new StdClass();
$fpp->bundle = $this->bundle;
$fpp->title = 'XSS test';
$fpp->reusable = 1;
$fpp->admin_title = "<script>alert('XSS!');</script>";
$fpp = fieldable_panels_panes_save($fpp);
$this
->checkAdminUiPaneTitleXss($fpp);
}