diff options
author | Julius Härtl <jus@bitgrid.net> | 2018-02-09 09:20:11 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-02-27 12:25:52 +0100 |
commit | 4f83462f6788b863bdeaa1e29c344dfc7550698c (patch) | |
tree | f4605abaacd08a176d4ed37383ec7240d2ffa766 /apps/files_sharing | |
parent | faeb277ece50f5c2d9016ad881b6eed74efd4f48 (diff) | |
download | nextcloud-server-4f83462f6788b863bdeaa1e29c344dfc7550698c.tar.gz nextcloud-server-4f83462f6788b863bdeaa1e29c344dfc7550698c.zip |
Add phpdoc, typehints and sanitize HTML
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/files_sharing')
-rw-r--r-- | apps/files_sharing/lib/Template/ExternalShareMenuAction.php | 16 | ||||
-rw-r--r-- | apps/files_sharing/lib/Template/LinkMenuAction.php | 17 |
2 files changed, 27 insertions, 6 deletions
diff --git a/apps/files_sharing/lib/Template/ExternalShareMenuAction.php b/apps/files_sharing/lib/Template/ExternalShareMenuAction.php index a81712cb591..f548a3bc6f1 100644 --- a/apps/files_sharing/lib/Template/ExternalShareMenuAction.php +++ b/apps/files_sharing/lib/Template/ExternalShareMenuAction.php @@ -28,11 +28,25 @@ use OCP\Util; class ExternalShareMenuAction extends SimpleMenuAction { + /** @var string */ private $owner; + + /** @var string */ private $displayname; + + /** @var string */ private $shareName; - public function __construct($label, $icon, $owner, $displayname, $shareName) { + /** + * ExternalShareMenuAction constructor. + * + * @param string $label + * @param string $icon + * @param string $owner + * @param string $displayname + * @param string $shareName + */ + public function __construct(string $label, string $icon, string $owner, string $displayname, string $shareName) { parent::__construct('save', $label, $icon); $this->owner = $owner; $this->displayname = $displayname; diff --git a/apps/files_sharing/lib/Template/LinkMenuAction.php b/apps/files_sharing/lib/Template/LinkMenuAction.php index af5fda94455..b75d8c2f790 100644 --- a/apps/files_sharing/lib/Template/LinkMenuAction.php +++ b/apps/files_sharing/lib/Template/LinkMenuAction.php @@ -24,23 +24,30 @@ namespace OCA\Files_Sharing\Template; use OCP\AppFramework\Http\Template\SimpleMenuAction; +use OCP\Util; class LinkMenuAction extends SimpleMenuAction { - public function __construct($label, $icon, $link) { + /** + * LinkMenuAction constructor. + * + * @param string $label + * @param string $icon + * @param string $link + */ + public function __construct(string $label, string $icon, string $link) { parent::__construct('directLink-container', $label, $icon, $link); } /** - * @since 14.0.0 * @return string */ public function render(): string { return '<li>' . '<a id="directLink-container">' . - '<span class="icon ' . $this->getIcon() . '"></span>' . - '<label for="directLink">' . $this->getLabel() . '</label>' . - '<input id="directLink" type="text" readonly="" value="' . $this->getLink() . '">' . + '<span class="icon ' . Util::sanitizeHTML($this->getIcon()) . '"></span>' . + '<label for="directLink">' . Util::sanitizeHTML($this->getLabel()) . '</label>' . + '<input id="directLink" type="text" readonly="" value="' . Util::sanitizeHTML($this->getLink()) . '">' . '</a>' . '</li>'; } |