Skip to content

Commit 3e2eb7a

Browse files
committed
fix: 修复 PHP 运行时派生触发 TDZ 报错
1 parent a2bdc01 commit 3e2eb7a

2 files changed

Lines changed: 35 additions & 36 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "stackprism",
33
"private": true,
4-
"version": "1.2.77",
4+
"version": "1.2.78",
55
"type": "module",
66
"description": "StackPrism 用于检测网页前端、后端、CDN、SaaS、广告营销、统计、登录、支付、网站程序和主题模板线索。",
77
"scripts": {

src/injected/page-detector.ts

Lines changed: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,40 @@ const detectPageTechnologies = (ruleConfig: Record<string, unknown> = {}) => {
1212
const documentHtmlSample = getHtmlSample()
1313
const globalKeys = safeGlobalKeys()
1414
const add = createCollector(technologies)
15+
const phpRuntimeTechnologyNames = new Set(
16+
[
17+
'WordPress',
18+
'ThinkPHP',
19+
'Discuz!',
20+
'phpBB',
21+
'Drupal',
22+
'Joomla',
23+
'Typecho',
24+
'Z-BlogPHP',
25+
'Emlog',
26+
'Magento / Adobe Commerce',
27+
'OpenCart',
28+
'PrestaShop',
29+
'DedeCMS',
30+
'EmpireCMS',
31+
'PHPCMS',
32+
'PHPWind',
33+
'BBSXP',
34+
'HDWiki',
35+
'MediaWiki',
36+
'Laravel',
37+
'Laravel Livewire',
38+
'Symfony',
39+
'Yii',
40+
'CodeIgniter',
41+
'CakePHP',
42+
'Laminas / Zend Framework',
43+
'Zend Framework',
44+
'Swoole',
45+
'OpenSwoole',
46+
'FrankenPHP'
47+
].map(normalizeRuleName)
48+
)
1549

1650
detectFrontendFrameworks(add, resources, classTokens, documentHtmlSample, globalKeys, ruleConfig.frontendFrameworks || [])
1751
detectUiFrameworks(add, resources, classTokens, cssVariables, documentHtmlSample, ruleConfig.uiFrameworks || [])
@@ -522,41 +556,6 @@ const detectPageTechnologies = (ruleConfig: Record<string, unknown> = {}) => {
522556
return items.some(item => item?.category === category && normalizeRuleName(item.name) === normalizedName)
523557
}
524558

525-
const phpRuntimeTechnologyNames = new Set(
526-
[
527-
'WordPress',
528-
'ThinkPHP',
529-
'Discuz!',
530-
'phpBB',
531-
'Drupal',
532-
'Joomla',
533-
'Typecho',
534-
'Z-BlogPHP',
535-
'Emlog',
536-
'Magento / Adobe Commerce',
537-
'OpenCart',
538-
'PrestaShop',
539-
'DedeCMS',
540-
'EmpireCMS',
541-
'PHPCMS',
542-
'PHPWind',
543-
'BBSXP',
544-
'HDWiki',
545-
'MediaWiki',
546-
'Laravel',
547-
'Laravel Livewire',
548-
'Symfony',
549-
'Yii',
550-
'CodeIgniter',
551-
'CakePHP',
552-
'Laminas / Zend Framework',
553-
'Zend Framework',
554-
'Swoole',
555-
'OpenSwoole',
556-
'FrankenPHP'
557-
].map(normalizeRuleName)
558-
)
559-
560559
function isPhpRuntimeSourceTechnology(item) {
561560
return phpRuntimeTechnologyNames.has(normalizeRuleName(item?.name))
562561
}

0 commit comments

Comments
 (0)