This repository was archived by the owner on May 15, 2026. It is now read-only.
Commit 16ee726
committed
fix(blog): replace iterative HTML tag stripping with single-pass angle bracket removal
The CodeQL scanner flagged the iterative stripHtmlTags function for
incomplete multi-character sanitization. The regex /<[^>]+>/g only
matches complete tags, so partial fragments like <script (without a
closing >) could survive intermediate loop iterations.
Since this function is only used for word counting in
calculateReadingTime, replace the multi-step approach with a simple
single-pass removal of all < and > characters. This eliminates the
incomplete sanitization pattern entirely.1 parent a840b07 commit 16ee726
1 file changed
Lines changed: 6 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
102 | | - | |
103 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
104 | 106 | | |
105 | 107 | | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
| 108 | + | |
115 | 109 | | |
116 | 110 | | |
117 | 111 | | |
| |||
0 commit comments