Skip to content

Commit f7e206b

Browse files
committed
Fix xdebug truthiness bug: preserve falsy value when disabled
When xdebug is disabled (xdebug: false), options.xdebug should remain falsy (false) for backward compatibility. Previously, it was being set to the string 'off' which is truthy in JavaScript, breaking any downstream code that checks if (options.xdebug) to determine if xdebug is enabled. The fix ensures options.xdebug stays false when mode is 'off', while still setting it to the mode string value when enabled.
1 parent 7d543ee commit f7e206b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

builders/php.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ const phpBuilder = {
284284
}
285285

286286
options._xdebugConfig = normalizeXdebugConfig(options.xdebug);
287-
options.xdebug = options._xdebugConfig.mode;
287+
options.xdebug = options._xdebugConfig.mode !== 'off' ? options._xdebugConfig.mode : false;
288288
if (options._xdebugConfig.mode !== 'off') {
289289
const xdebugFile = path.join(options.confDest, options.defaultFiles.xdebug);
290290
fs.mkdirSync(options.confDest, {recursive: true});

0 commit comments

Comments
 (0)