Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Regexp generated from unescaped input in #expand_class

オープン
#1,845 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@jaynetics がすでに取り組んでいます。

2026年10月10日 から。

  • #1846 @jaynetics による — オープン

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
ruby
領域
cli

調査の方向性

The unescaped input is interpolated into a regexp in #expand_class in lib/rdoc/ri/driver.rb, near line 972, and #expand_name (around line 998) calls it. Other regexps in that file escape their input, so compare with those. Pull request #1846 is already open against this issue, so review it before starting. Done means $\ no longer triggers the 'has ']' without escape' warning in tab completion, and the input is escaped the same way as elsewhere in driver.rb.

索引モデルが issue の本文から書いたものです。

説明

It happens here:

https://github.com/ruby/rdoc/blob/929a03646a2df1057570e8ab070e1f2016da5505/lib/rdoc/ri/driver.rb#L972

For example, when typing $ into IRB and then hitting tab to go through the autocomplete suggestions, this prints the following warning once $\ is reached.

rdoc/ri/driver.rb:972: warning: regular expression has ']' without escape: /\A$\[^:]*\z/
Image

Backtrace:

rdoc-8.1.0/lib/rdoc/ri/driver.rb:998:in 'RDoc::RI::Driver#expand_name'
irb-1.18.0/lib/irb/input-method.rb:410:in 'IRB::RelineInputMethod#rdoc_dialog_contents'
irb-1.18.0/lib/irb/input-method.rb:378:in 'block in IRB::RelineInputMethod#show_doc_dialog_proc'

This happens because $\ is embedded unescaped into the regexp, generating /\A$\[...].../.

Perhaps a crafty actor could even inject a Regexp that times out or raises a RegexpError.

All other regexps generated in driver.rb use escaped input, so I assume it is just an oversight in this case.

主要言語
Ruby
スター
927
フォーク
467
平均マージ
23時間 47分
マージ済み PR(30日)
12

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

ruby/rdoc のほかの issue

ruby/rdoc の issue をすべて見る

似ている issue

Ruby の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。