{"record":{"id":"7096f33cd420163f","repo":"zxing/zxing","slug":"tel-must-not-contains-characters","errorCode":null,"errorMessage":"Tel must not contains ; characters","messagePattern":"Tel must not contains ; characters","errorType":"validation","errorClass":"GeneratorException","httpStatus":null,"severity":"warning","filePath":"zxing.appspot.com/src/main/java/com/google/zxing/web/generator/client/ContactInfoGenerator.java","lineNumber":190,"sourceCode":"    return input;\n  }\n  \n  private String getCompanyField() {\n    return company.getText();\n  }\n\n  private String getTitleField() {\n    return title.getText();\n  }\n\n  private String getTelField() throws GeneratorException {\n    String input = Validators.filterNumber(tel.getText());\n    if (input.isEmpty()) {\n      return \"\";\n    }\n    Validators.validateNumber(input);\n    if (input.contains(\";\")) {\n      throw new GeneratorException(\"Tel must not contains ; characters\");\n    }\n    return input;\n  }\n  \n  private String getUrlField() throws GeneratorException {\n    String input = url.getText();\n    if (input != null && !input.isEmpty()) {\n      Validators.validateUrl(input);\n    }\n    return input;\n  }\n  \n  private String getEmailField() throws GeneratorException {\n    String input = email.getText();\n    if (input.isEmpty()) {\n      return \"\";\n    }\n    Validators.validateEmail(input);","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/zxing/zxing/blob/19aa2d8254410e161f04dc3c928e68d5e90233c2/zxing.appspot.com/src/main/java/com/google/zxing/web/generator/client/ContactInfoGenerator.java#L172-L208","documentation":"Thrown by ContactInfoGenerator.getTelField when the telephone string, after filtering, still contains a semicolon. Semicolons delimit vCard/MeCard components and would break the QR payload structure, so they are explicitly forbidden even though Validators.filterNumber already strips spaces, dots, commas, hyphens and parentheses. Client-side (GWT) input validation in the ZXing web generator.","triggerScenarios":"The user enters a phone number containing a ';' (e.g. a number with an extension separator like '555;123') that survives filterNumber, and triggers generation.","commonSituations":"Phone numbers pasted from PBX/extension formats using ';' as a separator; SIP URI fragments; malicious or accidental semicolon entry.","solutions":["Remove all ';' characters from the telephone field before generating.","Use a different separator for extensions (the generator will not encode ';' safely) or omit extensions.","Sanitize input in a change handler to strip ';\\n'.","Note filterNumber only removes [ .,\\-()] — add ';' to the sanitization step."],"exampleFix":"// before\nString input = \"555;123\"; // contains ';' -> throws\n\n// after\nString input = \"555123\"; // or \"555-123\" which filterNumber strips to 555123","handlingStrategy":"validation","validationCode":"String input = Validators.filterNumber(tel.getText());\nif (input.indexOf(';') >= 0) {\n  // strip or reject the semicolon before generation\n  input = input.replace(\";\", \"\");\n}","typeGuard":"boolean hasNoSemicolon(String s) {\n  return s == null || s.indexOf(';') < 0;\n}","tryCatchPattern":"try {\n  generator.getText();\n} catch (GeneratorException e) {\n  // tel contained ';'; tell user to remove it\n}","preventionTips":["Strip ';' from phone input in a change handler (filterNumber does not remove it).","Use a different convention for extensions; the generator cannot encode ';'.","Reject paste of PBX-formatted numbers."],"tags":["zxing","vcard","validation","ui","gwt","contact","phone"],"backgroundTag":null,"analyzedSha":"19aa2d8254410e161f04dc3c928e68d5e90233c2","analyzedAt":"2026-08-14T03:07:53.428Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}