You are here

public function FppWithPanelsTest::testTitleXss in Fieldable Panels Panes (FPP) 7

Make sure titles with XSS code can't break the site.

File

tests/fpp.with_panels.test, line 106
Tests for the Fieldable Panels Panes module with Panels.

Class

FppWithPanelsTest
Tests for the Fieldable Panels Panes module with Panels.

Code

public function testTitleXss() {

  // Create an FPP with an XSS payload in the entity title.
  $fpp = new StdClass();
  $fpp->bundle = $this->bundle;
  $fpp->title = "<script>alert('XSS!');</script>";
  $fpp->reusable = 1;
  $fpp->admin_title = '';
  $fpp = fieldable_panels_panes_save($fpp);
  $this
    ->checkAdminUiPaneTitleXss($fpp);
}