How to use GitHub
- Please use the 👍 reaction to show that you are affected by the same issue.
- Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
- Subscribe to receive notifications on status change and new comments.
Steps to reproduce
- Create a new credential or go to edit an existing one
- Add an URL with restricted favicon.ico (for example https://www.autodesk.com/)
- In the label section select the icon and from the "Pick an icon" window select "Get icon from page".
- The Nextcloud log file will present an error
Expected behaviour
The expectation is PassMan to ignore the icon request if a third-party firewall refuse to hand over a favicon.ico file.
Solution (valid for PHP 8.0+)
Open the file ../passman/lib/Controller/IconController.php
Go to line 58 and find
if ($icon->icoExists) {
$icon_json['type'] = $icon->icoType;
$icon_json['content'] = base64_encode($icon->icoData);
return new JSONResponse($icon_json);
}
Replace it with
if (isset($icon->icoExists) && $icon->icoExists) {
$icon_json['type'] = isset($icon->icoType) ? $icon->icoType : 'png';
$icon_json['content'] = isset($icon->icoData) ? base64_encode($icon->icoData) : '';
return new JSONResponse($icon_json);
}
Go to line 93 and find
if ($icon->icoExists) {
$data = $icon->icoData;
$type = $icon->icoType;
}
Replace it with
if (isset($icon->icoExists) && $icon->icoExists) {
if (isset($icon->icoData)) {
$data = $icon->icoData;
}
if (isset($icon->icoType)) {
$type = $icon->icoType;
}
}
How to use GitHub
Steps to reproduce
Expected behaviour
The expectation is PassMan to ignore the icon request if a third-party firewall refuse to hand over a favicon.ico file.
Solution (valid for PHP 8.0+)
Open the file ../passman/lib/Controller/IconController.php
Go to line 58 and find
if ($icon->icoExists) {
$icon_json['type'] = $icon->icoType;
$icon_json['content'] = base64_encode($icon->icoData);
return new JSONResponse($icon_json);
}
Replace it with
if (isset($icon->icoExists) && $icon->icoExists) {
$icon_json['type'] = isset($icon->icoType) ? $icon->icoType : 'png';
$icon_json['content'] = isset($icon->icoData) ? base64_encode($icon->icoData) : '';
return new JSONResponse($icon_json);
}
Go to line 93 and find
if ($icon->icoExists) {
$data = $icon->icoData;
$type = $icon->icoType;
}
Replace it with
if (isset($icon->icoExists) && $icon->icoExists) {
if (isset($icon->icoData)) {
$data = $icon->icoData;
}
if (isset($icon->icoType)) {
$type = $icon->icoType;
}
}