Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 310 and 311] [Versions 311 and 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403] [Versions 39 and 311]

Private url module utility functions

Copyright: 2009 Petr Skoda {@link http://skodak.org}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 595 lines (21 kb)
Included or required:0 times
Referenced: 3 times
Includes or requires: 0 files

Defines 15 functions


Functions that are not part of a class:

url_appears_valid_url($url)   X-Ref
This methods does weak url validation, we are looking for major problems only,
no strict RFE validation.

param: $url
return: bool true is seems valid, false if definitely not valid URL

url_fix_submitted_url($url)   X-Ref
Fix common URL problems that we want teachers to see fixed
the next time they edit the resource.

This function does not include any XSS protection.

param: string $url
return: string

url_get_full_url($url, $cm, $course, $config=null)   X-Ref
Return full url with all extra parameters

This function does not include any XSS protection.

param: string $url
param: object $cm
param: object $course
param: object $config
return: string url with & encoded as &

url_filter_callback($matches)   X-Ref
Unicode encoding helper callback

param: array $matches
return: string

url_print_header($url, $cm, $course)   X-Ref
Print url header.

param: object $url
param: object $cm
param: object $course
return: void

url_print_heading($url, $cm, $course, $notused = false)   X-Ref
Print url heading.

param: object $url
param: object $cm
param: object $course
param: bool $notused This variable is no longer used.
return: void

url_print_intro($url, $cm, $course, $ignoresettings=false)   X-Ref
Print url introduction.

param: object $url
param: object $cm
param: object $course
param: bool $ignoresettings print even if not specified in modedit
return: void

url_display_frame($url, $cm, $course)   X-Ref
Display url frames.

param: object $url
param: object $cm
param: object $course
return: does not return

url_print_workaround($url, $cm, $course)   X-Ref
Print url info and link.

param: object $url
param: object $cm
param: object $course
return: does not return

url_display_embed($url, $cm, $course)   X-Ref
Display embedded url file.

param: object $url
param: object $cm
param: object $course
return: does not return

url_get_final_display_type($url)   X-Ref
Decide the best display format.

param: object $url
return: int display type constant

url_get_variable_options($config)   X-Ref
Get the parameters that may be appended to URL

param: object $config url module config options
return: array array describing opt groups

url_get_variable_values($url, $cm, $course, $config)   X-Ref
Get the parameter values that may be appended to URL

param: object $url module instance
param: object $cm
param: object $course
param: object $config module config options
return: array of parameter values

url_get_encrypted_parameter($url, $config)   X-Ref
BC internal function

param: object $url
param: object $config
return: string

url_guess_icon($fullurl, $size = null)   X-Ref
Optimised mimetype detection from general URL

param: $fullurl
param: int $size of the icon.
return: string|null mimetype or null when the filetype is not relevant.