ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 2854


Ignore:
Timestamp:
May 13, 2007, 3:01:28 AM (13 years ago)
Author:
ogawa
Message:

#744:SQLの「IN ()」でカッコ内が空の場合にMySQLエラーが発生する

Location:
OpenPNE/branches/2.6.x/webapp
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/branches/2.6.x/webapp/lib/db/bookmark.php

    r665 r2854  
    6969{
    7070    $bookmarks = db_bookmark_c_member_id_list($c_member_id, true);
     71    if (!$bookmarks) {
     72        return array();
     73    }
    7174    $ids = implode(',', array_map('intval', $bookmarks));
    7275
     
    8992{
    9093    $bookmarks = db_bookmark_c_member_id_list($c_member_id, true);
     94    if (!$bookmarks) {
     95        return array();
     96    }
    9197    $ids = implode(',', array_map('intval', $bookmarks));
    9298
     
    107113{
    108114    $bookmarks = db_bookmark_c_member_id_list($c_member_id, true);
     115    if (!$bookmarks) {
     116        return array(array(), false, false, 0);
     117    }
    109118    $ids = implode(',', array_map('intval', $bookmarks));
    110119
     
    178187}
    179188
    180 ?>
    181 <?php
    182 /**
    183  * @copyright 2005-2006 OpenPNE Project
    184  * @license   http://www.php.net/license/3_01.txt PHP License 3.01
    185  */
    186 
    187189/**
    188190 * お気に入り追加
  • OpenPNE/branches/2.6.x/webapp/lib/db/commu.php

    r2398 r2854  
    553553
    554554    if (empty($result)) {
    555         return null;
     555        return array();
    556556    } else {
    557557        $result = implode(",", $result);
     
    14661466
    14671467    if (!$result) {
    1468         return null;
     1468        return array();
    14691469    }
    14701470
     
    19081908function db_commu_c_event_mail_confirm_list4c_member_ids($c_member_ids)
    19091909{
     1910    if (!$c_member_ids) {
     1911        return array();
     1912    }
    19101913    $c_member_id_str = implode(',', array_map('intval', $c_member_ids));
    19111914    $sql = "SELECT * FROM c_member" .
  • OpenPNE/branches/2.6.x/webapp/lib/db/diary.php

    r2829 r2854  
    5454    $sql = 'SELECT c_diary_category_id FROM c_diary_category_diary WHERE c_diary_id = ?';
    5555    $category_list = db_get_col($sql, array(intval($c_diary_id)));
    56     $ids = join(',', $category_list);
     56    if (!$category_list) {
     57        return array();
     58    }
     59    $ids = implode(',', $category_list);
    5760
    5861    $sql = 'SELECT c_diary_category_id, category_name FROM c_diary_category'
     
    7578    $sql = 'SELECT c_diary_id FROM c_diary_category_diary WHERE c_diary_category_id = ?';
    7679    $diary_list = db_get_col($sql, array(intval($c_diary_category_id)));
    77     $ids = join(',', $diary_list);
     80    if (!$diary_list) {
     81        return array(array(), false, false, 0);
     82    }
     83    $ids = implode(',', $diary_list);
    7884
    7985    $pf_cond = db_diary_public_flag_condition($c_member_id, $u);
     
    382388{
    383389    $friends = db_friend_c_member_id_list($c_member_id, true);
     390    if (!$friends) {
     391        return array(array(), false, false, 0);
     392    }
    384393    $ids = implode(',', array_map('intval', $friends));
    385394
     
    467476
    468477    $friends = db_friend_c_member_id_list($c_member_id, true);
     478    if (!$friends) {
     479        return array();
     480    }
    469481    $ids = implode(',', array_map('intval', $friends));
    470482
     
    552564
    553565    $friends = db_friend_c_member_id_list($c_member_id);
     566    $firends[] = 0;
    554567    $friend_ids = implode(',', $friends);
    555568
  • OpenPNE/branches/2.6.x/webapp/lib/db/member.php

    r2637 r2854  
    12811281function db_member_delete_c_member_pre($c_member_id, $delete_c_member_ids)
    12821282{
    1283     if (!is_array($delete_c_member_ids)) {
     1283    if (!(is_array($delete_c_member_ids) && $delete_c_member_ids)) {
    12841284        return false;
    12851285    }
     
    13031303function db_member_delete_c_member_ktai_pre($c_member_id, $delete_c_member_ids)
    13041304{
    1305     if (!is_array($delete_c_member_ids)) {
     1305    if (!is_array($delete_c_member_ids) && $delete_c_member_ids) {
    13061306        return false;
    13071307    }
     
    13991399    // 存在するIDのみを抽出
    14001400    $c_member_id_block = array_unique(array_map('intval', $c_member_id_block));
     1401    if (!$c_member_id_block) {
     1402        return false;
     1403    }
    14011404    $ids = implode(',', $c_member_id_block);
    14021405    $sql = 'SELECT c_member_id FROM c_member WHERE c_member_id IN ('.$ids.')';
  • OpenPNE/branches/2.6.x/webapp/lib/db/review.php

    r1447 r2854  
    1717{
    1818    $friends = db_friend_c_member_id_list($c_member_id);
     19    if (!$friends) {
     20        return array();
     21    }
    1922    $ids = implode(',', array_map('intval', $friends));
    2023
     
    386389function db_review_c_member_review_add_confirm_c_member_review4c_review_id($c_review_id, $c_member_id)
    387390{
     391    if (!$c_review_id) {
     392        return array();
     393    }
    388394    $c_review_id_str = implode(',', array_map('intval', $c_review_id));
    389395    $sql = "SELECT * FROM c_review as cr, c_review_comment as crc , c_review_category as crc2 " .
  • OpenPNE/branches/2.6.x/webapp/lib/db/rss.php

    r546 r2854  
    3131{
    3232    $friends = db_friend_c_member_id_list($c_member_id, true);
     33    if (!$friends) {
     34        return array();
     35    }
    3336    $ids = implode(',', array_map('intval', $friends));
    3437
  • OpenPNE/branches/2.6.x/webapp/modules/ktai/page/c_invite.php

    r1268 r2854  
    1616
    1717        //ランダムフレンドリスト
    18         $this->set("c_friend_list", k_p_c_invite_c_friend_list_random4c_member_id4c_commu_id($u, $target_c_commu_id, 50));
     18        $this->set("c_friend_list", db_commu_c_friend_list_random4c_member_id4c_commu_id($u, $target_c_commu_id, 50));
    1919
    2020        //コミュニティID
Note: See TracChangeset for help on using the changeset viewer.