forked from thibaud-rohmer/PhotoShow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
71 lines (59 loc) · 1.81 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
/**
* This file implements the index.
*
* PHP versions 4 and 5
*
* LICENSE:
*
* This file is part of PhotoShow.
*
* PhotoShow is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PhotoShow is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PhotoShow. If not, see <http://www.gnu.org/licenses/>.
*
* @category Website
* @package Photoshow
* @author Thibaud Rohmer <thibaud.rohmer@gmail.com>
* @copyright 2011 Thibaud Rohmer
* @license http://www.gnu.org/licenses/
* @link http://github.com/thibaud-rohmer/PhotoShow-v2
*/
/// Start session
session_start();
/// Because we don't care about notices
if(function_exists("error_reporting")){
error_reporting(E_ERROR | E_WARNING);
}
/// Autoload classes
function __autoload($class){
require_once(realpath(dirname(__FILE__)."/src/classes/$class.php"));
}
/// Take care of nasty exceptions
function exception_handler($exception) {
echo "<div class='exception'>" , $exception->getMessage(), "</div>\n";
}
set_exception_handler('exception_handler');
ini_set('upload_max_filesize','10M');
function protect_user_send_var($var){
if(is_array($var))
return array_map('protect_user_send_var', $var);
else
return addslashes($var);
}
if (!get_magic_quotes_gpc()){
$_POST = protect_user_send_var($_POST);
$_COOKIE = protect_user_send_var($_COOKIE);
$_GET = protect_user_send_var($_GET);
}
new Index();
?>