Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moodle-qtype_stack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elc
moodle-qtype_stack
Commits
1f532c2c
Commit
1f532c2c
authored
1 year ago
by
Chris Sangwin
Browse files
Options
Downloads
Patches
Plain Diff
Use Moodle file download functions to respect proxy settings.
parent
cf0950fa
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
vle_specific.php
+5
-3
5 additions, 3 deletions
vle_specific.php
with
5 additions
and
3 deletions
vle_specific.php
+
5
−
3
View file @
1f532c2c
...
...
@@ -225,7 +225,7 @@ function question_display_options() {
*
* Returns the string content of the URL/file. If failign return false.
*/
function
stack_fetch_included_content
(
string
$url
)
:
string
|
bool
{
function
stack_fetch_included_content
(
string
$url
)
{
static
$cache
=
[];
$lc
=
trim
(
strtolower
(
$url
));
$good
=
false
;
...
...
@@ -272,11 +272,13 @@ function stack_fetch_included_content(string $url): string | bool {
// Just remember that $islocalfile might be true and you might do
// something else then.
if
(
$islocalfile
)
{
$translated
=
clean_param
(
$translated
,
PARAM_SAFEPATH
);
$cache
[
$translated
]
=
file_get_contents
(
$translated
);
}
else
{
$translated
=
clean_param
(
$translated
,
PARAM_URL
);
$headers
=
get_headers
(
$translated
);
if
(
strpos
(
$headers
[
0
],
'404'
)
===
false
)
{
$cache
[
$translated
]
=
file_
get_
content
s
(
$translated
);
$cache
[
$translated
]
=
download_
file_content
(
$translated
);
}
else
{
$cache
[
$translated
]
=
false
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment