aboutsummaryrefslogtreecommitdiffstats
path: root/include/ws_functions.inc.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2008-10-16 00:38:26 +0000
committerrvelices <rv-github@modusoptimus.com>2008-10-16 00:38:26 +0000
commitebc3c2e2f7d9408db7e5335d63fdd2a003c3d79a (patch)
treed2b00fb200eab5f807b6eac33e8e692031227a1b /include/ws_functions.inc.php
parenteb667c7711d61d0c757f2202af6c2e61cba7d1ac (diff)
merge 2755 and 2756 from branch 2.0 to trunk
- 2755 fix vulnerability http://www.milw0rm.com/exploits/6755 - 2756 security paranoia: protect session/remember me cookies from XSS attacks (works only if php>=5.2 and with IE/FF maybe others) git-svn-id: http://piwigo.org/svn/trunk@2757 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/ws_functions.inc.php')
-rw-r--r--include/ws_functions.inc.php18
1 files changed, 5 insertions, 13 deletions
diff --git a/include/ws_functions.inc.php b/include/ws_functions.inc.php
index f14aff70a..a41212f5f 100644
--- a/include/ws_functions.inc.php
+++ b/include/ws_functions.inc.php
@@ -1187,17 +1187,9 @@ function ws_session_login($params, &$service)
*/
function ws_session_logout($params, &$service)
{
- global $user, $conf;
if (!is_a_guest())
{
- $_SESSION = array();
- session_unset();
- session_destroy();
- setcookie(session_name(),'',0,
- ini_get('session.cookie_path'),
- ini_get('session.cookie_domain')
- );
- setcookie($conf['remember_me_name'], '', 0, cookie_path());
+ logout_user();
}
return true;
}
@@ -1435,7 +1427,7 @@ function ws_categories_add($params, &$service)
}
invalidate_user_cache();
-
+
return $creation_output;
}
@@ -1473,18 +1465,18 @@ function ws_images_exist($params, &$service)
-1,
PREG_SPLIT_NO_EMPTY
);
-
+
$query = '
SELECT
id,
md5sum
FROM '.IMAGES_TABLE.'
- WHERE md5sum IN (\''.implode("','", $md5sums).'\')
+ WHERE md5sum IN (\''.implode("','", $md5sums).'\')
;';
$id_of_md5 = simple_hash_from_query($query, 'md5sum', 'id');
$result = array();
-
+
foreach ($md5sums as $md5sum)
{
$result[$md5sum] = null;