Open Steinblock opened 3 years ago
On my nuget server search failed for a package with an ampersand in the title, i.e. Tom & Jerry
Tom & Jerry
/var/www/simple-nuget-server/inc/feedwriter.php:213
SimpleXMLElement::addChild(): unterminated entity reference Jerry
https://server.tld/Search()?$filter=IsLatestVersion&searchTerm='Tom'&targetFramework='net472'&includePrerelease=false&$skip=0&$top=26&semVerLevel=2.0.0'
Replacing $value with htmlspecialchars($value) solved the issue
$value
htmlspecialchars($value)
private function addMeta($entry, $name, $value, $type = null) { $node = $entry->addChild( $name, htmlspecialchars($value), $value, 'http://schemas.microsoft.com/ado/2007/08/dataservices' );
Thanks! Feel free to submit a pull request with the fix.
On my nuget server search failed for a package with an ampersand in the title, i.e.
Tom & Jerry
/var/www/simple-nuget-server/inc/feedwriter.php:213
https://server.tld/Search()?$filter=IsLatestVersion&searchTerm='Tom'&targetFramework='net472'&includePrerelease=false&$skip=0&$top=26&semVerLevel=2.0.0'
Replacing
$value
withhtmlspecialchars($value)
solved the issue