diff --git a/.travis.yml b/.travis.yml index 4e57c61a..58d1e07d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,15 +24,14 @@ matrix: env: DB=mysqli allow_failures: - php: hhvm - - env: DB=sqlite3 fast_finish: true env: global: - EXTNAME="board3/portal" - - SNIFF="0" # Should we run code sniffer on your code? - - IMAGE_ICC="0" # Should we run icc profile sniffer on your images? - - PHPBB_BRANCH="ticket/12483" # - PHPBB_BRANCH="develop-ascraeus" + - SNIFF="1" # Should we run code sniffer on your code? + - IMAGE_ICC="1" # Should we run icc profile sniffer on your images? + - PHPBB_BRANCH="develop-ascraeus" branches: except: diff --git a/modules/birthday_list.php b/modules/birthday_list.php index 1ed2d10f..36164b78 100644 --- a/modules/birthday_list.php +++ b/modules/birthday_list.php @@ -103,14 +103,22 @@ class birthday_list extends module_base break; } - $sql = 'SELECT u.user_id, u.username, u.user_colour, u.user_birthday - FROM ' . USERS_TABLE . ' u - LEFT JOIN ' . BANLIST_TABLE . " b ON (u.user_id = b.ban_userid) - WHERE (b.ban_id IS NULL + $sql_array = array( + 'SELECT' => 'u.user_id, u.username, u.user_colour, u.user_birthday', + 'FROM' => array(USERS_TABLE => 'u'), + 'LEFT_JOIN' => array( + array( + 'FROM' => array(BANLIST_TABLE => 'b'), + 'ON' => 'u.user_id = b.ban_userid', + ), + ), + 'WHERE' => "(b.ban_id IS NULL OR b.ban_exclude = 1) - AND (u.user_birthday LIKE '" . $this->db->sql_escape(sprintf('%2d-%2d-', $now['mday'], $now['mon'])) . "%' {$sql_days}) - AND u.user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ') - ORDER BY ' . $order_by; + AND (u.user_birthday " . $this->db->sql_like_expression($this->db->any_char . sprintf('%2d-%2d-', $now['mday'], $now['mon']) . $this->db->any_char) . " {$sql_days}) + AND " . $this->db->sql_in_set('u.user_type', array(USER_NORMAL , USER_FOUNDER)), + 'ORDER BY' => $order_by, + ); + $sql = $this->db->sql_build_query('SELECT', $sql_array); $result = $this->db->sql_query($sql); $today = sprintf('%2d-%2d-', $now['mday'], $now['mon']); diff --git a/tests/unit/functions/check_file_src_test.php b/tests/unit/functions/check_file_src_test.php index 71471631..ee594937 100644 --- a/tests/unit/functions/check_file_src_test.php +++ b/tests/unit/functions/check_file_src_test.php @@ -9,6 +9,7 @@ require_once(dirname(__FILE__) . '/../../../includes/functions.php'); require_once(dirname(__FILE__) . '/../../../../../../includes/functions_acp.php'); +require_once(dirname(__FILE__) . '/../../../../../../includes/functions.php'); class phpbb_functions_check_file_src_test extends \board3\portal\tests\testframework\database_test_case { diff --git a/travis/prepare-phpbb.sh b/travis/prepare-phpbb.sh index a5782e9c..01770ad6 100755 --- a/travis/prepare-phpbb.sh +++ b/travis/prepare-phpbb.sh @@ -21,4 +21,4 @@ cp -R . ../../tmp cd ../../ # Clone phpBB -git clone --depth=1 "git://github.com/nickvergessen/phpbb.git" "phpBB3" --branch=$BRANCH +git clone --depth=1 "git://github.com/phpbb/phpbb.git" "phpBB3" --branch=$BRANCH