We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 429af12 commit fb4e07fCopy full SHA for fb4e07f
src/js/matrix.js
@@ -685,9 +685,8 @@ Matrix.prototype.fromLine = function(line) {
685
let field0 = fields[0];
686
687
// Switches
688
- let pos = field0.indexOf(':');
689
- if ( pos !== -1 ) {
690
- let switchName = field0.slice(0, pos);
+ if ( this.reSwitchRule.test(field0) ) {
+ let switchName = field0.slice(0, -1);
691
let srcHostname = punycode.toASCII(fields[1]);
692
let state = fields[2];
693
if (
@@ -736,6 +735,8 @@ Matrix.prototype.fromLine = function(line) {
736
735
return true;
737
};
738
+Matrix.prototype.reSwitchRule = /^[0-9a-z-]+:$/;
739
+
740
/******************************************************************************/
741
742
Matrix.prototype.toSelfie = function() {
0 commit comments