fix uncomplete url
This commit is contained in:
parent
81c6cee481
commit
8984f759ed
1 changed files with 7 additions and 3 deletions
10
_admin.php
10
_admin.php
|
@ -77,18 +77,22 @@ class tweakStoresBehaviors
|
||||||
$file_content = __('This module has no repository set in its _define.php file.');
|
$file_content = __('This module has no repository set in its _define.php file.');
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
|
$url = $modules[$_POST['checkxml_id']]['repository'];
|
||||||
|
if (false === strpos($url, 'dcstore.xml')) {
|
||||||
|
$url .= '/dcstore.xml';
|
||||||
|
}
|
||||||
if (function_exists('curl_init')) {
|
if (function_exists('curl_init')) {
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||||
curl_setopt($ch, CURLOPT_HEADER, false);
|
curl_setopt($ch, CURLOPT_HEADER, false);
|
||||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
||||||
curl_setopt($ch, CURLOPT_URL, $modules[$_POST['checkxml_id']]['repository']);
|
curl_setopt($ch, CURLOPT_URL, $url);
|
||||||
curl_setopt($ch, CURLOPT_REFERER, $modules[$_POST['checkxml_id']]['repository']);
|
curl_setopt($ch, CURLOPT_REFERER, $url);
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
$file_content = curl_exec($ch);
|
$file_content = curl_exec($ch);
|
||||||
curl_close($ch);
|
curl_close($ch);
|
||||||
} else {
|
} else {
|
||||||
$file_content = file_get_contents($modules[$_POST['checkxml_id']]['repository']);
|
$file_content = file_get_contents($url);
|
||||||
}
|
}
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$file_content = __('Failed to read third party repository');
|
$file_content = __('Failed to read third party repository');
|
||||||
|
|
Loading…
Reference in a new issue