Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
<dl>
<dt>{lang}wcf.acp.devtools.project.quickSetup.path{/lang}</dt>
<dd>
<input type="text" name="projectQuickSetupPath" id="projectQuickSetupPath" class="long" />
<input type="text" name="projectQuickSetupPath" id="projectQuickSetupPath" class="long" placeholder="{unsafe:$wcfDir}" />
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would you use unsafe: here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC I've copied it from another template. Not necessary at this point?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a general guideline: Never use unsafe: unless you actually need it. The performance gains are negligible but you risk malformed HTML or XSS. This also makes it much easier to test for security issues because in HTML any variable that is escaped before outputting is safe by definition.

<small>{lang}wcf.acp.devtools.project.quickSetup.path.description{/lang}</small>
</dd>
</dl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use wcf\data\devtools\project\DevtoolsProjectList;
use wcf\page\SortablePage;
use wcf\system\WCF;

/**
* Shows a list of devtools projects.
Expand Down Expand Up @@ -51,4 +52,14 @@ class DevtoolsProjectListPage extends SortablePage
* @inheritDoc
*/
public $validSortFields = ['projectID', 'name', 'path'];

#[\Override]
public function assignVariables()
{
parent::assignVariables();

WCF::getTPL()->assign([
'wcfDir' => WCF_DIR,
]);
}
}