ILIAS
release_6 Revision v6.24-5-g0c8bfefb3b8
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
$
_
a
b
c
d
e
f
g
h
i
j
l
m
p
s
t
w
+
Functions
_
a
b
c
f
g
h
i
s
t
w
+
Variables
$
c
d
e
f
g
h
j
l
m
p
s
t
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Files
File List
+
Globals
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Modules
Pages
AbstractMediaWithPath.php
Go to the documentation of this file.
1
<?php
namespace
ILIAS\GlobalScreen\Scope\Layout\MetaContent\Media
;
2
7
abstract
class
AbstractMediaWithPath
extends
AbstractMedia
8
{
9
public
function
getContent
() : string
10
{
11
$content
= parent::getContent();
12
13
// the version string is only appended if the content string is not
14
// a data uri, otherwise the data uri will behave incorrectly.
15
if
(!$this->
isContentDataUri
(
$content
)) {
16
if
($this->
hasContentParameters
(
$content
)) {
17
return
rtrim(
$content
,
"&"
) .
"&version="
.
$this->version
;
18
}
else
{
19
return
rtrim(
$content
,
"?"
) .
"?version="
.
$this->version
;
20
}
21
}
22
23
return
$content
;
24
}
25
26
protected
function
isContentDataUri
(
string
$content
) : bool
27
{
28
// regex pattern matches if a string follows the data uri syntax.
29
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs#syntax
30
31
return
(
bool
) preg_match(
'/^(data:)([a-z\/]*)((;base64)?)(,?)([A-z0-9=]*)$/'
, $content);
32
}
33
34
protected
function
hasContentParameters
(
string
$content
) : bool
35
{
36
return
(strpos($content,
"?"
) !==
false
);
37
}
38
}
ILIAS\GlobalScreen\Scope\Layout\MetaContent\Media\AbstractMediaWithPath\hasContentParameters
hasContentParameters(string $content)
Definition:
AbstractMediaWithPath.php:34
ILIAS\GlobalScreen\Scope\Layout\MetaContent\Media\AbstractMedia\$content
$content
Definition:
AbstractMedia.php:27
ILIAS\GlobalScreen\Scope\Layout\MetaContent\Media\AbstractMediaWithPath
Class AbstractMediaWithPath.
Definition:
AbstractMediaWithPath.php:7
ILIAS\GlobalScreen\Scope\Layout\MetaContent\Media\AbstractMediaWithPath\getContent
getContent()
Definition:
AbstractMediaWithPath.php:9
ILIAS\GlobalScreen\Scope\Layout\MetaContent\Media\AbstractMedia\$version
$version
Definition:
AbstractMedia.php:31
ILIAS\GlobalScreen\Scope\Layout\MetaContent\Media\AbstractMediaWithPath\isContentDataUri
isContentDataUri(string $content)
Definition:
AbstractMediaWithPath.php:26
ILIAS\GlobalScreen\Scope\Layout\MetaContent\Media\AbstractMedia
Class Js.
Definition:
AbstractMedia.php:21
ILIAS\GlobalScreen\Scope\Layout\MetaContent\Media
Definition:
AbstractCollection.php:1
src
GlobalScreen
Scope
Layout
MetaContent
Media
AbstractMediaWithPath.php
Generated on Thu Apr 10 2025 20:01:34 for ILIAS by
1.8.13 (using
Doxyfile
)