scripts: validate the first Comments-URI entry #2233

pull grandpig wants to merge 1 commits into bitcoin:master from grandpig:master changing 3 files +74 −1
  1. grandpig commented at 10:46 AM on August 3, 2026: none

    The Comments-URI validation condition was reversed when the field was made optional.

    $found{'Comments-URI'} is incremented only after the current header line has been processed. As a result, the existing condition skipped validation for the first entry and applied it to continuation entries instead.

    This allowed a nonstandard first Comments-URI to pass, while rejecting a valid external discussion URI following the standard Comments wiki URI.

    Restore the original condition so that only the first entry must match:

    https://github.com/bitcoin/bips/wiki/Comments:BIP-NNNN

    Additional continuation entries remain unrestricted.

  2. scripts: validate the first Comments-URI entry
    Signed-off-by: grandpig <grandpig@outlook.com>
    e0e377e9ba
  3. murchandamus added the label CI on Aug 5, 2026
  4. in scripts/buildtable.pl:200 in e0e377e9ba
     196 | @@ -197,7 +197,7 @@
     197 |  				die "Unacceptable license $val in $fn" unless exists $AcceptableLicenses{$val} or ($val eq 'PD' and exists $GrandfatheredPD{$bipnum}) or ($val eq 'CC-BY-SA-4.0' and exists $GrandfatheredCCBySA{$bipnum});
     198 |  			}
     199 |  		} elsif ($field eq 'Comments-URI') {
     200 | -			if ($found{'Comments-URI'}) {
     201 | +			if (not $found{'Comments-URI'}) {
    


    murchandamus commented at 10:27 PM on August 5, 2026:

    This change makes sense to me. I see that I introduced this mistake in #1820. Thanks for catching that.

    It’s not clear to me why we should be adding the second script to our build actions. It seems to be a proof that the bugfix change is correct, but if that’s the case adding it to the build actions going forth seems unnecessary.

Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bips. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-08-12 06:10 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me