GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(id/web): detectLanguage own-key guards — prototype names are not languages (#2787) by dezren39 · Pull Request #2788 · developing-today/code

Conversation

@dezren39

@dezren39 dezren39 commented Oct 30, 2026 •
edited by blacksmith-sh Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Fixes #2787

detectLanguage() looked up arbitrary filename extensions/stems in the plain-object maps EXT_TO_LANG / FILENAME_TO_LANG with truthiness checks, so inherited Object.prototype members counted as hits: notes.constructor returned the Object constructor function and notes.__proto__ returned a prototype object as the file's "language" (declared return type string | undefined). The LANG_IMPORTS lookup in ensureLanguage had the same flaw for an authored code-block language attribute — constructor was actually called as an import function.

Fix: own-key (Object.hasOwn) guards at all three detectLanguage lookup sites and at the LANG_IMPORTS lookup in ensureLanguage. Unknown/prototype names now fall through to undefined / "language not in registry" as intended.

Verification (laptop worktree, off main 24ddc15):

  • Probe importing the real module before the fix reproduced all four bad returns; after the fix all return undefined, controls (app.ts → typescript, Dockerfile → dockerfile, unknown ext) unchanged. Probe: ~/git/fleet/probe-2026-10-30-laneB-highlightproto/
  • vitest run src/highlight.test.ts: 99/99 pass (2 new tests cover the prototype extension and filename paths)
  • tsc --noEmit: clean

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chatgpt-codex-connector[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@dezren39
fix(id/web): detectLanguage only honours own keys of its language maps (
9ee4a5d
#2787)
@dezren39
dezren39 requested a review from a team as a code owner October 30, 2026 16:27
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T16:28:55.603191Z 9ee4a5d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dezren39 dezren39 added kind/bug Something isn't working (prefixed form of the classic bug label) app/id Package/app: id (pkgs/ or apps/ in this repo) source/creator Filed by the new-issue-creator job queue/needs-review Queue task finished and is awaiting review work/self-assigned An agent grabbed this item directly, outside the queue labels Oct 30, 2026
@dezren39 dezren39 mentioned this pull request Oct 30, 2026
id(web): detectLanguage returns Object.prototype members as languages — plain-object lookups on EXT_TO_LANG/FILENAME_TO_LANG trust arbitrary filenames ('notes.constructor' returns the Object constructor, '__proto__' returns a prototype object) #2787
Closed
@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
  • X
  • Mastodon
  • Reddit
  • LinkedIn

Comment @coderabbitai help to get the list of available commands.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 merged commit da42bfe into main Oct 30, 2026
1 check failed

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 deleted the creator-b/2787-highlight-proto branch October 30, 2026 16:28
@dezren39 dezren39 removed queue/needs-review Queue task finished and is awaiting review work/self-assigned An agent grabbed this item directly, outside the queue labels Oct 30, 2026
@dezren39 dezren39 mentioned this pull request Oct 30, 2026
id(web): classify_tag treats any '.archive.' filename as an archive — notes.archive.txt renders with an 'archive: ?' badge, sorts out of the primary list, and links by hash instead of by name #2793
Closed
This was referenced Nov 21, 2026
Closure audit: every closed issue/PR verified; unmerged branches + unpushed worktrees inventoried #7079
Open
AUDIT-7 Lane 1 — PR-SWEEP tracking (open PRs, 4 repos) #13872
Open
Open-PR clearance programme 2026-11-24: every open PR merged, fixed+merged, or tasked #14166
Open
Audit programme: seven-lane review of PRs, issues and designs (2026-11-23) #13871
Open
Stray work audit: PRs and issues not tied to a design or roadmap item #13874
Open
pm metadata: resolve native parents consistently in sweeper and webhook ingestion #16011
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

app/id Package/app: id (pkgs/ or apps/ in this repo) kind/bug Something isn't working (prefixed form of the classic bug label) source/creator Filed by the new-issue-creator job

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

id(web): detectLanguage returns Object.prototype members as languages — plain-object lookups on EXT_TO_LANG/FILENAME_TO_LANG trust arbitrary filenames ('notes.constructor' returns the Object constructor, '__proto__' returns a prototype object)

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@dezren39
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.