dncuug / X.PagedList

Library for easily paging through any IEnumerable/IQueryable in ASP.NET
https://andrew.gubskiy.com/open-source
MIT License
899 stars 213 forks source link

Pagination HTML output contains encoded HTML entities, breaking HTML validation #241

Closed alb-xss closed 1 year ago

alb-xss commented 1 year ago

Describe the bug The pagination HTML result contains encoded HTML entities, even for class names, href, etc.

To Reproduce Steps to reproduce the behavior:

  1. Start the Example.Website project
  2. View HTML source

Example <div class="&#x70;&#x61;&#x67;&#x69;&#x6E;&#x61;&#x74;&#x69;&#x6F;&#x6E;&#x2D;&#x63;&#x6F;&#x6E;&#x74;&#x61;&#x69;&#x6E;&#x65;&#x72;"><ul class="&#x70;&#x61;&#x67;&#x69;&#x6E;&#x61;&#x74;&#x69;&#x6F;&#x6E;"><li class="&#x61;&#x63;&#x74;&#x69;&#x76;&#x65;"><span>&#x31;</span></li><li><a href="[&#x2F;&#x3F;&#x70;&#x61;&#x67;&#x65;&#x3D;&#x32;](view-source:https://localhost:44326/?page=2)">&#x32;</a></li><li><a href="[&#x2F;&#x3F;&#x70;&#x61;&#x67;&#x65;&#x3D;&#x33;](view-source:https://localhost:44326/?page=3)">&#x33;</a></li><li><a href="[&#x2F;&#x3F;&#x70;&#x61;&#x67;&#x65;&#x3D;&#x34;](view-source:https://localhost:44326/?page=4)">&#x34;</a></li><li><a href="[&#x2F;&#x3F;&#x70;&#x61;&#x67;&#x65;&#x3D;&#x35;](view-source:https://localhost:44326/?page=5)">&#x35;</a></li><li><a href="[&#x2F;&#x3F;&#x70;&#x61;&#x67;&#x65;&#x3D;&#x36;](view-source:https://localhost:44326/?page=6)">&#x36;</a></li><li><a href="[&#x2F;&#x3F;&#x70;&#x61;&#x67;&#x65;&#x3D;&#x37;](view-source:https://localhost:44326/?page=7)">&#x37;</a></li><li><a href="[&#x2F;&#x3F;&#x70;&#x61;&#x67;&#x65;&#x3D;&#x38;](view-source:https://localhost:44326/?page=8)">&#x38;</a></li><li><a href="[&#x2F;&#x3F;&#x70;&#x61;&#x67;&#x65;&#x3D;&#x39;](view-source:https://localhost:44326/?page=9)">&#x39;</a></li><li><a href="[&#x2F;&#x3F;&#x70;&#x61;&#x67;&#x65;&#x3D;&#x31;&#x30;](view-source:https://localhost:44326/?page=10)">&#x31;&#x30;</a></li><li class="&#x50;&#x61;&#x67;&#x65;&#x64;&#x4C;&#x69;&#x73;&#x74;&#x2D;&#x65;&#x6C;&#x6C;&#x69;&#x70;&#x73;&#x65;&#x73;"><a class="&#x50;&#x61;&#x67;&#x65;&#x64;&#x4C;&#x69;&#x73;&#x74;&#x2D;&#x73;&#x6B;&#x69;&#x70;&#x54;&#x6F;&#x4E;&#x65;&#x78;&#x74;" href="[&#x2F;&#x3F;&#x70;&#x61;&#x67;&#x65;&#x3D;&#x31;&#x31;](view-source:https://localhost:44326/?page=11)" rel="&#x6E;&#x65;&#x78;&#x74;">&#8230;</a></li><li class="&#x50;&#x61;&#x67;&#x65;&#x64;&#x4C;&#x69;&#x73;&#x74;&#x2D;&#x73;&#x6B;&#x69;&#x70;&#x54;&#x6F;&#x4E;&#x65;&#x78;&#x74;"><a href="[&#x2F;&#x3F;&#x70;&#x61;&#x67;&#x65;&#x3D;&#x32;](view-source:https://localhost:44326/?page=2)" rel="&#x6E;&#x65;&#x78;&#x74;">></a></li><li class="&#x50;&#x61;&#x67;&#x65;&#x64;&#x4C;&#x69;&#x73;&#x74;&#x2D;&#x73;&#x6B;&#x69;&#x70;&#x54;&#x6F;&#x4C;&#x61;&#x73;&#x74;"><a href="[&#x2F;&#x3F;&#x70;&#x61;&#x67;&#x65;&#x3D;&#x34;&#x34;&#x31;](view-source:https://localhost:44326/?page=441)">>></a></li></ul></div>

Expected behavior HTML attributes should not be entity encoded