W3C 错误验证 - 元素 a 上的属性 href 值错误:查询中存在非法字符:不是 URL 代码点

mdi*_*n18 5 html w3c-validation

href我得到了元素上属性的错误值a:查询中的非法字符:不是带有以下a标记的 W3C 上的 URL 代码点:

<a href="/edit_booking.php?requestID=84&amp;moduleID=109&amp;no_rooms=2&amp;parks=Central,East&amp;rooms=1,39&amp;weeks=1,3,5,7,9,11,13,15&amp;day=1&amp;semester=1&amp;start_time=09:00&amp;end_time=10:00&amp;length=1&amp;students=100&amp;type=Lecture&amp;Priority=N&amp;metaID=&amp;comments=Crappy Booking&amp;status=1&amp;round=1&amp;date_submitted=2015-02-16 05:01:17&amp;year=2015/2016&amp;" title="This is a link edit the booking"><i class="fa fa-edit"></i></a>
Run Code Online (Sandbox Code Playgroud)

该链接是由 PHP 生成的;现在,如果不允许使用逗号,我可以进行替换,但我不确定是否允许使用这种格式。

有什么东西我错过了,因为它对我来说看起来不错吗?

Bol*_*ock 5

查询字符串中的空格导致了错误。在您的示例中,它们出现在两个位置:comments=Crappy Bookingdate_submitted=2015-02-16 05:01:17

%20按照验证器的建议,将空格 URL 编码为,允许您的标记进行验证:

<a href="/edit_booking.php? ... &amp;comments=Crappy%20Booking&amp;status=1&amp;round=1&amp;date_submitted=2015-02-16%2005:01:17&amp;year=2015/2016&amp;" title="This is a link edit the booking"><i class="fa fa-edit"></i></a>
Run Code Online (Sandbox Code Playgroud)