Ticket #4060 (closed defect: fixed)

Opened 9 months ago

Last modified 9 months ago

PHP syntax highlighting breaks on single quoted strings that end with escaped backslash

Reported by: gszymaszek Owned by: andrew_b
Priority: trivial Milestone: 4.8.25
Component: mcedit Version: master
Keywords: syntax Cc:
Blocked By: Blocking:
Branch state: merged Votes for changeset: committed-master

Description

Consider the following simple PHP code:

<?php
$a = 'Aaa\\';
echo $a, PHP_EOL;

There’s an escaped backslash in the $a string, so that the code would print:

Aaa\

mcedit doesn’t see the escaped backslash, it sees an escaped quotation mark and thinks that the rest of the code is still that $a string:

<?php
$a = 'xxxx\';
echo $a, PHP_EOL;

Attachments

0001-Escape-backslashes-in-PHP-single-quote-string.patch (1.1 KB) - added by gszymaszek 9 months ago.

Change History

Changed 9 months ago by gszymaszek

comment:1 Changed 9 months ago by andrew_b

  • Owner set to andrew_b
  • Status changed from new to accepted

comment:2 Changed 9 months ago by andrew_b

  • Status changed from accepted to testing
  • Votes for changeset set to committed-master
  • Resolution set to fixed
  • Branch state changed from no branch to merged

comment:3 Changed 9 months ago by andrew_b

  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.