Skip to content

Commit ed6b940

Browse files
committed
variables: Relax variable name validation
Fixes #700
1 parent 92e675e commit ed6b940

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/models/variables.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const {GObject} = imports.gi;
2323
const {FlatpakSharedModel} = imports.models.shared;
2424
const {FlatsealOverrideStatus} = imports.models.overrideStatus;
2525

26-
var VAR_REGEXP = /^\w+=[\S ]+$/;
26+
var VAR_REGEXP = /^[^;]+=[\S ]+$/;
2727

2828
var FlatpakVariablesModel = GObject.registerClass({
2929
GTypeName: 'FlatpakVariablesModel',
@@ -75,7 +75,7 @@ var FlatpakVariablesModel = GObject.registerClass({
7575

7676
static deserialize(value) {
7777
return value
78-
.split(/(?=;[\w\s]+=)/)
78+
.split(/(?=;[^;]+=)/)
7979
.map(v => v.replace(/^;/, ''));
8080
}
8181

tests/src/testModels.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ describe('Model', function() {
803803

804804
expect(permissionsDefault.variables).toEqual('TEST=yes');
805805

806-
permissionsDefault.set_property('variables', 'TEST=yes;TE ST=no');
806+
permissionsDefault.set_property('variables', 'TEST=yes;TE;ST=no');
807807

808808
GLib.timeout_add(GLib.PRIORITY_HIGH, delay + 1, () => {
809809
expect(GLib.access(_environmentOverride, 0)).toEqual(-1);

0 commit comments

Comments
 (0)