ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
_include.php File Reference

Go to the source code of this file.

Functions

 removeMagicQuotes ()
 Disable magic quotes if they are enabled. More...
 
 SimpleSAML_exception_handler ($exception)
 
 SimpleSAML_error_handler ($errno, $errstr, $errfile=null, $errline=0, $errcontext=null)
 

Variables

 if (version_compare(PHP_VERSION, '5.4.0', '<'))
 
 try
 

Function Documentation

◆ removeMagicQuotes()

removeMagicQuotes ( )

Disable magic quotes if they are enabled.

Definition at line 6 of file _include.php.

7{
8 if (get_magic_quotes_gpc()) {
9 foreach (array('_GET', '_POST', '_COOKIE', '_REQUEST') as $a) {
10 if (isset($$a) && is_array($$a)) {
11 foreach ($$a as &$v) {
12 // we don't use array-parameters anywhere. Ignore any that may appear
13 if (is_array($v)) {
14 continue;
15 }
16 // unescape the string
17 $v = stripslashes($v);
18 }
19 }
20 }
21 }
22 if (get_magic_quotes_runtime()) {
23 set_magic_quotes_runtime(false);
24 }
25}
26
27if (version_compare(PHP_VERSION, '5.4.0', '<')) {
29}
removeMagicQuotes()
Disable magic quotes if they are enabled.
Definition: _include.php:6

◆ SimpleSAML_error_handler()

SimpleSAML_error_handler (   $errno,
  $errstr,
  $errfile = null,
  $errline = 0,
  $errcontext = null 
)

Definition at line 62 of file _include.php.

63{
64 if (!class_exists('SimpleSAML\Logger')) {
65 /* We are probably logging a deprecation-warning during parsing. Unfortunately, the autoloader is disabled at
66 * this point, so we should stop here.
67 *
68 * See PHP bug: https://bugs.php.net/bug.php?id=47987
69 */
70 return false;
71 }
72
73 if (SimpleSAML\Logger::isErrorMasked($errno)) {
74 // masked error
75 return false;
76 }
77
78 static $limit = 5;
79 $limit -= 1;
80 if ($limit < 0) {
81 // we have reached the limit in the number of backtraces we will log
82 return false;
83 }
84
85 // show an error with a full backtrace
86 $e = new SimpleSAML_Error_Exception('Error '.$errno.' - '.$errstr);
87 $e->logError();
88
89 // resume normal error processing
90 return false;
91}
92
93set_error_handler('SimpleSAML_error_handler');
94
95try {
97} catch (Exception $e) {
98 throw new \SimpleSAML\Error\CriticalConfigurationError(
99 $e->getMessage()
100 );
101}
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.
Attribute-related utility methods.

Referenced by SimpleSAML_exception_handler().

+ Here is the caller graph for this function:

◆ SimpleSAML_exception_handler()

SimpleSAML_exception_handler (   $exception)

Definition at line 38 of file _include.php.

39{
40 SimpleSAML\Module::callHooks('exception_handler', $exception);
41
42 if ($exception instanceof SimpleSAML_Error_Error) {
43 $exception->show();
44 } elseif ($exception instanceof Exception) {
45 $e = new SimpleSAML_Error_Error('UNHANDLEDEXCEPTION', $exception);
46 $e->show();
47 } else {
48 if (class_exists('Error') && $exception instanceof Error) {
49 $code = $exception->getCode();
50 $errno = ($code > 0) ? $code : E_ERROR;
51 $errstr = $exception->getMessage();
52 $errfile = $exception->getFile();
53 $errline = $exception->getLine();
54 SimpleSAML_error_handler($errno, $errstr, $errfile, $errline);
55 }
56 }
57}
SimpleSAML_error_handler($errno, $errstr, $errfile=null, $errline=0, $errcontext=null)
Definition: _include.php:62
static callHooks($hook, &$data=null)
Call a hook in all enabled modules.
Definition: Module.php:364
$code
Definition: example_050.php:99

References $code, SimpleSAML\Module\callHooks(), and SimpleSAML_error_handler().

+ Here is the call graph for this function:

Variable Documentation

◆ if

if(version_compare(PHP_VERSION, '5.4.0', '<')) ( version_compare(PHP_VERSION, '5.4.0', '<')  )

Definition at line 27 of file _include.php.

◆ try

try
Initial value:

Definition at line 95 of file _include.php.