stable

Clone or download

Read-only

feat: detect misusages of variables

If the user enters `${ DOCUMENT_TITLE }` instead of `${DOCUMENT_TITLE}` then the variable won't be interpreted. In order to prevent such situation, we now detect if the format is not correct. Since the content is up to the user, in order to avoid false positive, the save is not blocked if we detect misusages, only a warning is raised. Part of story #38630: Export to file Change-Id: Ide1d0151703ea245f0c5cf81253fd3522872b6e2

Modified Files

Name
M plugins/pdftemplate/include/PdfTemplate/Admin/CreatePdfTemplateController.php +6 −0 Go to diff View file
M plugins/pdftemplate/include/PdfTemplate/Admin/DisplayPdfTemplateUpdateFormController.php +6 −0 Go to diff View file
M plugins/pdftemplate/include/PdfTemplate/Admin/UpdatePdfTemplateController.php +6 −0 Go to diff View file
A plugins/pdftemplate/include/PdfTemplate/Variable/VariableMisusageCollector.php +72 −0 Go to diff View file
A plugins/pdftemplate/include/PdfTemplate/Variable/VariableMisusageInTemplateDetector.php +57 −0 Go to diff View file
M plugins/pdftemplate/include/pdftemplatePlugin.php +5 −0 Go to diff View file
M plugins/pdftemplate/site-content/fr_FR/LC_MESSAGES/tuleap-pdftemplate.po +32 −0 Go to diff View file
M plugins/pdftemplate/tests/unit/PdfTemplate/Admin/CreatePdfTemplateControllerTest.php +5 −0 Go to diff View file
M plugins/pdftemplate/tests/unit/PdfTemplate/Admin/DisplayPdfTemplateUpdateFormControllerTest.php +7 −0 Go to diff View file
M plugins/pdftemplate/tests/unit/PdfTemplate/Admin/UpdatePdfTemplateControllerTest.php +4 −0 Go to diff View file
A plugins/pdftemplate/tests/unit/PdfTemplate/Variable/VariableMisusageCollectorTest.php +136 −0 Go to diff View file
A plugins/pdftemplate/tests/unit/PdfTemplate/Variable/VariableMisusageInTemplateDetectorTest.php +94 −0 Go to diff View file
M src/common/Http/Response/RedirectWithFeedbackFactory.php +3 −2 Go to diff View file
M src/common/Layout/Feedback/FeedbackSerializer.php +5 −3 Go to diff View file
M src/common/Layout/Feedback/ISerializeFeedback.php +1 −1 Go to diff View file
M src/common/Option/Option.php +7 −6 Go to diff View file
M tests/lib/Stubs/FeedbackSerializerStub.php +4 −2 Go to diff View file