if ($hostVal == '') {
continue;
}
- $str .= $hostProp . '=' . $hostVal . "\n";
+ $str .= $hostProp
+ . '=' . static::quoteIniValue($hostVal) . "\n";
}
}
$cfgFilePath = $this->getConfigFilePath();
}
return null;
}
+
+ public static function quoteIniValue($val)
+ {
+ if (strpos($val, '=') === false) {
+ return $val;
+ }
+ return '"' . $val . '"';
+ }
}
?>
$baseUrl = new \Net_URL2($server);
$doc = new \DOMDocument();
- $doc->loadHTMLFile($server);
+ @$doc->loadHTMLFile($server);
$sx = simplexml_import_dom($doc);
if ($sx === false) {
Log::err('Error loading URL: ' . $server);
file_put_contents(
$file,
- 'micropub=' . $this->micropub . "\n"
- . 'media=' . $this->media . "\n"
- . 'token=' . $this->token . "\n"
- . 'authorization=' . $this->authorization . "\n"
+ 'micropub=' . Config::quoteIniValue($this->micropub) . "\n"
+ . 'media=' . Config::quoteIniValue($this->media) . "\n"
+ . 'token=' . Config::quoteIniValue($this->token) . "\n"
+ . 'authorization='
+ . Config::quoteIniValue($this->authorization) . "\n"
);
}