Skip to content

Error for Complex (curly) syntax, e.g., "{$some_var}" #35

@bugfolder

Description

@bugfolder

Using the complex curly syntax (variable embedded in a string) creates an error. For example,

  $var = 'bar';
  $name = "foo{$var}";

generates this error message:

ERROR: Illegal string offset 'value' on line 2308 in /mysite/modules/contrib/coder_upgrade/grammar_parser/list.inc (Warning)

The problem is in the data parser. In function PGPReader::buildString() (reader.inc, line 2952), the 'close' token is a literal curly brace, which means that on line 2308, $data is that literal string, and not a token array. The solution is to give 'close' its own case statement that uses $data directly. This fixes the error and generates a correct result.

I will prepare a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions