Skip to content

Commit

Permalink
Merge pull request #49 from RhymeDigital/dev_adam
Browse files Browse the repository at this point in the history
Fix for REQUEST_TOKEN
  • Loading branch information
rhymeadam committed Feb 29, 2024
2 parents 4fcdbfa + c483369 commit 63b64c6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Backend/Page/Callbacks.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@
namespace Rhyme\ContaoBackendThemeBundle\Backend\Page;

use Contao\Controller;
use Contao\ArrayUtil;
use Contao\System;
use Contao\DataContainer;
use Contao\Image;
use Contao\Input;
use Contao\StringUtil;

/**
Expand All @@ -41,7 +40,12 @@ public static function editLayout(DataContainer $dc)
}

$title = sprintf($GLOBALS['TL_LANG']['MSC']['editRelatedLayout'], $dc->value);
$requestToken = System::getContainer()
->get('contao.csrf.token_manager')
->getDefaultTokenValue()
;

return ' <a href="contao/main.php?do=themes&amp;table=tl_layout&amp;act=edit&amp;id=' . $dc->value . '&amp;popup=1&amp;nb=1&amp;rt=' . REQUEST_TOKEN . '" title="' . StringUtil::specialchars($title) . '" onclick="Backend.openModalIframe({\'title\':\'' . StringUtil::specialchars(str_replace("'", "\\'", $title)) . '\',\'url\':this.href});return false">' . Image::getHtml('alias.svg', $title) . '</a>';

return ' <a href="contao/main.php?do=themes&amp;table=tl_layout&amp;act=edit&amp;id=' . $dc->value . '&amp;popup=1&amp;nb=1&amp;rt=' . $requestToken . '" title="' . StringUtil::specialchars($title) . '" onclick="Backend.openModalIframe({\'title\':\'' . StringUtil::specialchars(str_replace("'", "\\'", $title)) . '\',\'url\':this.href});return false">' . Image::getHtml('alias.svg', $title) . '</a>';
}
}

0 comments on commit 63b64c6

Please sign in to comment.