Skip to content

SourceHgWeb metadata pattern does not work with PHP 5.5.9 #275

Description

@epaul13

I had to patch SourceHgWeb.php to make Mantis / Hgweb integration to work. It seems that my php version does not like the metadata pattern.

In function commit_changeset, I had to replace:

$s_pattern_metadata = '/^# (?:'
                . self::PATTERN_USER . '|'
                . self::PATTERN_DATE . '|'
                . self::PATTERN_REVISION
                . ')/J';

with

$s_pattern_metadata = '/^# (?J)(?:'
                . self::PATTERN_USER . '|'
                . self::PATTERN_DATE . '|'
                . self::PATTERN_REVISION
                . ')';

to make it work.

Source/SourceHgWeb version 2.1.2:

class SourceHgWebPlugin extends MantisSourcePlugin {
    const PLUGIN_VERSION = '2.1.2';
    /* ... */

PHP version 5.5.9:

$ php --version
PHP 5.5.9-1ubuntu4.25 (cli) (built: May 10 2018 14:37:18) 

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions