@zohodesk/client_build_tool 0.0.11-exp.28.0 → 0.0.11-exp.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -15,10 +15,12 @@ const REQUIRED_OPTIONS = ['jsResourcePath', 'propertiesFolderPath', 'numericMapP
|
|
|
15
15
|
function validatePathSecurity(path, fieldName) {
|
|
16
16
|
if (!path || typeof path !== 'string') {
|
|
17
17
|
return;
|
|
18
|
-
}
|
|
18
|
+
} // Allow relative paths within project structure (../assets, etc.)
|
|
19
|
+
// Block dangerous patterns like ../../etc/passwd
|
|
20
|
+
|
|
19
21
|
|
|
20
|
-
if (path.includes('..')) {
|
|
21
|
-
throw new Error(`[I18nOptionsValidator] Invalid ${fieldName} contains
|
|
22
|
+
if (path.includes('../..') || path.startsWith('/') && path.includes('..')) {
|
|
23
|
+
throw new Error(`[I18nOptionsValidator] Invalid ${fieldName} contains suspicious path: ${path}`);
|
|
22
24
|
}
|
|
23
25
|
}
|
|
24
26
|
|
package/lib/shared/bundler/webpack/custom_plugins/I18nNumericIndexPlugin/I18nNumericIndexPlugin.js
CHANGED
|
@@ -157,12 +157,6 @@ class I18nNumericIndexPlugin {
|
|
|
157
157
|
if (missingPaths.length > 0) {
|
|
158
158
|
const errorMessage = ['', '🚨 I18N BUILD FAILURE: Critical i18n files are missing!', '', 'The following required files could not be found:', ...missingPaths.map(path => ` ❌ ${path}`), '', 'These files are essential for i18n functionality. Please ensure they exist before building.', '', 'Resolved paths checked:', ...resolvedPaths.map(path => ` 📁 ${path}`), ''].join('\n');
|
|
159
159
|
throw new Error(errorMessage);
|
|
160
|
-
} // Log successful validation in development mode
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
if (compiler.options.mode === 'development') {
|
|
164
|
-
console.log('✅ I18n critical file validation passed:');
|
|
165
|
-
resolvedPaths.forEach(path => console.log(` 📁 ${path}`));
|
|
166
160
|
}
|
|
167
161
|
}
|
|
168
162
|
|
|
@@ -54,7 +54,9 @@ function i18nIdReplaceLoaderConfig(options) {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
const allI18nData = loadJSResourcesOnce(options);
|
|
57
|
-
|
|
57
|
+
|
|
58
|
+
const i18nKeyReplaceLoaderPath = require.resolve('../loaders/i18nIdReplaceLoader.js');
|
|
59
|
+
|
|
58
60
|
let numericIdMap;
|
|
59
61
|
|
|
60
62
|
try {
|