mirror of
https://github.com/moodle/moodle.git
synced 2025-08-09 10:56:56 +02:00
Merge branch 'wip-mdl-50675' of https://github.com/rajeshtaneja/moodle
This commit is contained in:
commit
154d468dbb
1 changed files with 3 additions and 3 deletions
|
@ -34,7 +34,7 @@ class wikimedia {
|
||||||
|
|
||||||
public function __construct($url = '') {
|
public function __construct($url = '') {
|
||||||
if (empty($url)) {
|
if (empty($url)) {
|
||||||
$this->api = 'http://commons.wikimedia.org/w/api.php';
|
$this->api = 'https://commons.wikimedia.org/w/api.php';
|
||||||
} else {
|
} else {
|
||||||
$this->api = $url;
|
$this->api = $url;
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ class wikimedia {
|
||||||
$this->_param['titles'] .= ('|'.urldecode($title));
|
$this->_param['titles'] .= ('|'.urldecode($title));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->_param['titles'] = urldecode($title);
|
$this->_param['titles'] = urldecode($titles);
|
||||||
}
|
}
|
||||||
$this->_param['prop'] = 'imageinfo';
|
$this->_param['prop'] = 'imageinfo';
|
||||||
$this->_param['iiprop'] = 'url';
|
$this->_param['iiprop'] = 'url';
|
||||||
|
@ -116,7 +116,7 @@ class wikimedia {
|
||||||
return $image_url;
|
return $image_url;
|
||||||
} else {
|
} else {
|
||||||
$thumb_url = '';
|
$thumb_url = '';
|
||||||
$commons_main_dir = 'http://upload.wikimedia.org/wikipedia/commons/';
|
$commons_main_dir = 'https://upload.wikimedia.org/wikipedia/commons/';
|
||||||
if ($image_url) {
|
if ($image_url) {
|
||||||
$short_path = str_replace($commons_main_dir, '', $image_url);
|
$short_path = str_replace($commons_main_dir, '', $image_url);
|
||||||
$extension = strtolower(pathinfo($short_path, PATHINFO_EXTENSION));
|
$extension = strtolower(pathinfo($short_path, PATHINFO_EXTENSION));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue