Skip to content

Not escaping */ in php comments #165

@tredvermtraud

Description

@tredvermtraud

While using this amazing tool I noticed that Comments are parsed from xsd to php without escaping slashes ( / ).
Thus resulting in a broken class (which can easily be fixed by escaping the slash with a backslash ( \ ) ).

The following XSD:

<xs:element name="uuidUrsprungsnachricht" minOccurs="0" type="bdt:UUID">
  <xs:annotation>
    <xs:documentation>[...] xga:satz/xga:*/xga:uuid [...]</xs:documentation>
  </xs:annotation>
</xs:element>

Results in the following PHP:

  /**
   * [...] xga:satz/xga:*/xga:uuid [...].
   *
   * @var string $uuidUrsprungsnachricht
   */
  private $uuidUrsprungsnachricht = null;

It could be fixable by just adding a backslash before the slash

  /**
   * [...] xga:satz\/xga:*\/xga:uuid [...]
   *
   * @var string $uuidUrsprungsnachricht
   */
  private $uuidUrsprungsnachricht = null;

I have shortened the commentary and replaced it with [...] to prevent unnecessary bloating.
I assume a simple search and replace could be all that is needed to prevent this in the future?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions