Skip to content

Commit a1e4d97

Browse files
committed
fix: correctly extract hex from masked URLs without S/A/D prefix
1 parent 4aa51fd commit a1e4d97

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/InspectLink.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,16 @@ private static function extractHex(string $input): string
109109
return $m[1];
110110
}
111111

112-
// Match A<hex> preceded by a space (%20, literal space, or +) in a steam:// / csgo:// URL
112+
// Classic/market URL: A<hex> preceded by %20, space, or + (A is a prefix marker, not hex)
113113
if (preg_match('/(?:%20|\s|\+)A([0-9A-Fa-f]+)/i', $stripped, $m)) {
114114
return $m[1];
115115
}
116116

117+
// Pure masked format: csgo_econ_action_preview%20<hexblob> (no S/A/M prefix)
118+
if (preg_match('/csgo_econ_action_preview(?:%20|\s|\+)([0-9A-Fa-f]{10,})$/i', $stripped, $m)) {
119+
return $m[1];
120+
}
121+
117122
// Bare hex — strip any whitespace
118123
return preg_replace('/\s+/', '', $stripped) ?? $stripped;
119124
}

0 commit comments

Comments
 (0)