@@ -655,17 +655,45 @@ runs these steps:
655
655
<li><p>If <var>asciiDomain</var> contains a <a>forbidden host code point</a>,
656
656
<a>validation error</a>, return failure.
657
657
658
-
<li><p>Let <var>ipv4Host</var> be the result of <a lt="IPv4 parser">IPv4 parsing</a>
659
-
<var>asciiDomain</var>.
660
-
661
-
<li><p>If <var>ipv4Host</var> is an <a>IPv4 address</a> or failure, return
662
-
<var>ipv4Host</var>.
658
+
<li><p>If <var>asciiDomain</var> <a lt="ends in a number checker">ends in a number</a>, then return
659
+
the result of <a lt="IPv4 parser">IPv4 parsing</a> <var>asciiDomain</var>.
663
660
664
661
<li><p>Return <var>asciiDomain</var>.
665
662
</ol>
666
663
667
664
<hr>
668
665
666
+
<p>The <dfn>ends in a number checker</dfn> takes a string <var>input</var> and then runs these
667
+
steps:
668
+
669
+
<ol>
670
+
<li><p>Let <var>parts</var> be the result of <a>strictly splitting</a> <var>input</var> on
671
+
U+002E (.).
672
+
673
+
<li>
674
+
<p>If the last <a for=list>item</a> in <var>parts</var> is the empty string, then:
675
+
676
+
<ol>
677
+
<li><p>If <var>parts</var>'s <a for=list>size</a> is 1, then return false.
678
+
679
+
<li><p><a for=list>Remove</a> the last <a for=list>item</a> from <var>parts</var>.
680
+
</ol>
681
+
682
+
<li><p>Let <var>last</var> be the last <a for=list>item</a> in <var>parts</var>.
683
+
684
+
<li><p>If parsing <var>last</var> as an <a lt="IPv4 number parser">IPv4 number</a> does not
685
+
return failure, then return true.
686
+
687
+
<li>
688
+
<p>If <var>last</var> is non-empty and contains only <a>ASCII digits</a>, then return true.
689
+
690
+
<p class=note>This can happen if <var>last</var> starts with "<code>0</code>" so the
691
+
<a lt="IPv4 number parser">IPv4 number parser</a> tries to parse it as octal, but it is not a
692
+
valid octal number, as is the case with, for example, "<code>09</code>".
693
+
694
+
<li><p>Return false.
695
+
</ol>
696
+
669
697
<p>The <dfn id=concept-ipv4-parser>IPv4 parser</dfn> takes a string <var>input</var> and then runs
670
698
these steps:
671
699
@@ -692,24 +720,19 @@ these steps:
692
720
but if it somehow is this conditional makes sure we can keep going. -->
693
721
</ol>
694
722
695
-
<li><p>If <var>parts</var>'s <a for=list>size</a> is greater than 4, then return <var>input</var>.
723
+
<li><p>If <var>parts</var>'s <a for=list>size</a> is greater than 4, <a>validation error</a>,
724
+
return failure.
696
725
697
726
<li><p>Let <var>numbers</var> be an empty <a for=/>list</a>.
698
727
699
728
<li>
700
729
<p><a for=list>For each</a> <var>part</var> of <var>parts</var>:
701
730
702
731
<ol>
703
-
<li>
704
-
<p>If <var>part</var> is the empty string, then return <var>input</var>.
705
-
706
-
<p class="example no-backref" id=example-c2afe535><code>0..0x300</code> is a
707
-
<a>domain</a>, not an <a>IPv4 address</a>.
708
-
709
732
<li><p>Let <var>result</var> be the result of <a lt="IPv4 number parser">parsing</a>
710
733
<var>part</var>.
711
734
712
-
<li><p>If <var>result</var> is failure, then return <var>input</var>.
735
+
<li><p>If <var>result</var> is failure, <a>validation error</a>, return failure.
713
736
714
737
<li><p>If <var>result</var>[1] is true, then set <var>validationError</var> to true.
715
738
@@ -754,6 +777,8 @@ these steps:
754
777
<p>The <dfn>IPv4 number parser</dfn> takes a string <var>input</var> and then runs these steps:
755
778
756
779
<ol>
780
+
<li><p>If <var>input</var> is the empty string, then return failure.
781
+
757
782
<li><p>Let <var>validationError</var> be false.
758
783
759
784
<li><p>Let <var>R</var> be 10.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4