Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-26964 URL returned by moodle_url::out_omit_querystring() may cont…

…ain the anchor part
  • Loading branch information...
commit 4927443761aa5a49b62cb34a0f8e0d7f52079bcf 1 parent 92a387b
@mudrd8mz mudrd8mz authored
Showing with 8 additions and 1 deletion.
  1. +8 −1 lib/weblib.php
View
9 lib/weblib.php
@@ -541,14 +541,21 @@ public function out($escaped = true, array $overrideparams = null) {
/**
* Returns url without parameters, everything before '?'.
+ *
+ * @param bool $includeanchor if {@link self::anchor} is defined, should it be returned?
* @return string
*/
- public function out_omit_querystring() {
+ public function out_omit_querystring($includeanchor = false) {
+
$uri = $this->scheme ? $this->scheme.':'.((strtolower($this->scheme) == 'mailto') ? '':'//'): '';
$uri .= $this->user ? $this->user.($this->pass? ':'.$this->pass:'').'@':'';
$uri .= $this->host ? $this->host : '';
$uri .= $this->port ? ':'.$this->port : '';
$uri .= $this->path ? $this->path : '';
+ if ($includeanchor and !is_null($this->anchor)) {
+ $uri .= '#' . $this->anchor;
+ }
+
return $uri;
}
Please sign in to comment.
Something went wrong with that request. Please try again.