| punbb-1.2.22/upload/include/common.php |
punbb-1.2.23/upload/include/common.php |
| 55: error_reporting(E_ALL ^ E_NOTICE); | 55: error_reporting(E_ALL ^ E_NOTICE); |
| 56: | 56: |
| 57: // Turn off magic_quotes_runtime | 57: // Turn off magic_quotes_runtime |
| 58: set_magic_quotes_runtime(0); | 58: if (get_magic_quotes_runtime()) |
| | 59: set_magic_quotes_runtime(0); |
| 59: | 60: |
| 60: // Strip slashes from GET/POST/COOKIE (if magic_quotes_gpc is enabled) | 61: // Strip slashes from GET/POST/COOKIE (if magic_quotes_gpc is enabled) |
| 61: if (get_magic_quotes_gpc()) | 62: if (get_magic_quotes_gpc()) |
| punbb-1.2.22/upload/include/functions.php |
punbb-1.2.23/upload/include/functions.php |
| 36: $cookie = array('user_id' => 1, 'password_hash' => 'Guest'); | 36: $cookie = array('user_id' => 1, 'password_hash' => 'Guest'); |
| 37: | 37: |
| 38: // If a cookie is set, we get the user_id and password hash from it | 38: // If a cookie is set, we get the user_id and password hash from it |
| 39: if (isset($_COOKIE[$cookie_name])) | 39: if (isset($_COOKIE[$cookie_name]) && preg_match('/a:2:{i:0;s:\d+:"(\d+)";i:1;s:\d+:"([0-9a-f]+)";}/', $_COOKIE[$cookie_name], $matches)) |
| 40: list($cookie['user_id'], $cookie['password_hash']) = @unserialize($_COOKIE[$cookie_name]); | 40: list(, $cookie['user_id'], $cookie['password_hash']) = $matches; |
| 41: | 41: |
| 42: if ($cookie['user_id'] > 1) | 42: if ($cookie['user_id'] > 1) |
| 43: { | 43: { |
| 368: { | 368: { |
| 369: list($last_post, $last_post_id, $last_poster) = $db->fetch_row($result); | 369: list($last_post, $last_post_id, $last_poster) = $db->fetch_row($result); |
| 370: | 370: |
| 371: $db->query('UPDATE '.$db->prefix.'forums SET num_topics='.$num_topics.', num_posts='.$num_posts.', last_post='.$last_post.', last_post_id='.$last_post_id.', last_poster=\''.$db->escape($last_poster).'\' WHERE id='.$forum_id) or error('Unable to update last_post/last_post_id/last_poster', __FILE__, __LINE__, $db->error()); | 371: $db->query('UPDATE '.$db->prefix.'forums SET num_topics='.$num_topics.', num_posts='.$num_posts.', last_post='.$last_post.', last_post_id='.$last_post_id.', last_poster=\''.$db->escape($last_poster).'\' WHERE id='.$forum_id) or error('Unable to update last_post/last_post_id/last_poster', __FILE__, __LINE__, $db->error()); |
| 372: } | 372: } |
| 373: else // There are no topics | 373: else // There are no topics |
| 374: $db->query('UPDATE '.$db->prefix.'forums SET num_topics='.$num_topics.', num_posts='.$num_posts.', last_post=NULL, last_post_id=NULL, last_poster=NULL WHERE id='.$forum_id) or error('Unable to update last_post/last_post_id/last_poster', __FILE__, __LINE__, $db->error()); | 374: $db->query('UPDATE '.$db->prefix.'forums SET num_topics='.$num_topics.', num_posts='.$num_posts.', last_post=NULL, last_post_id=NULL, last_poster=NULL WHERE id='.$forum_id) or error('Unable to update last_post/last_post_id/last_poster', __FILE__, __LINE__, $db->error()); |