octobercms / install

Installation wizard for October CMS
122 stars 91 forks source link

MySQL passwords with special characters break installer #48

Closed alexhouse closed 10 years ago

alexhouse commented 10 years ago

Took me a while to figure this one out but it appears when using a password like 1oinv"£$2tc, the $2 portion buggers up when building configuration files (specifically the $ character).

The result from InstallerRewrite::parseContent() ends up looking like this:

        'mysql' => array(
            'driver'    => 'mysql',
            'host'      => 'localhost',
            'port'      => 3306,
            'database'  => 'database',
            'username'  => 'username',
            'password'  => '1oinv"£'password'  => tc',
            'charset'   => 'utf8',
            'collation' => 'utf8_unicode_ci',
            'prefix'    => '',
        ),

which ends up with this error:

Unable to rewrite key "connections.mysql.host" in config, does it exist?syntax error, unexpected 'password' (T_STRING), expecting ')'

Fairly simple fix, just requires a str_replace on $replaceValue. I'll submit a pull request now.