Passed
Push — master ( b8a060...ff0e39 )
by Tim
02:43
created

sanitize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
/*
4
 *    simpleSAMLphp-casserver is a CAS 1.0 and 2.0 compliant CAS server in the form of a simpleSAMLphp module
5
 *
6
 *    Copyright (C) 2013  Bjorn R. Jensen
7
 *
8
 *    This library is free software; you can redistribute it and/or
9
 *    modify it under the terms of the GNU Lesser General Public
10
 *    License as published by the Free Software Foundation; either
11
 *    version 2.1 of the License, or (at your option) any later version.
12
 *
13
 *    This library is distributed in the hope that it will be useful,
14
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16
 *    Lesser General Public License for more details.
17
 *
18
 *    You should have received a copy of the GNU Lesser General Public
19
 *    License along with this library; if not, write to the Free Software
20
 *    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
21
 *
22
 */
23
24
use SimpleSAML\Configuration;
25
use SimpleSAML\Module\casserver\Cas\ServiceValidator;
26
use SimpleSAML\Module\casserver\Cas\TicketValidator;
27
28
/**
29
 * @deprecated
30
 * @see ServiceValidator
31
 * @param string $service
32
 * @param array $legal_service_urls
33
 * @return bool
34
 */
35
function checkServiceURL($service, array $legal_service_urls)
36
{
37
    //delegate to ServiceValidator until all references to this can be cleaned up
38
    $config = Configuration::loadFromArray(['legal_service_urls' => $legal_service_urls]);
39
    $serviceValidator = new ServiceValidator($config);
40
    return $serviceValidator->checkServiceURL($service) !== null;
41
}
42
43
44
/**
45
 * @param string $parameter
46
 * @return string
47
 */
48
function sanitize($parameter)
49
{
50
    return TicketValidator::sanitize($parameter);
51
}
52