<commit_before><?php
/**
 * rep2 - 2chOC
 */

// {{{ login2ch()

/**
 * 2ch IDɃOC
 *
 * @return  string|false  2ch SIDԂ
 */
function login2ch()
{
    global $_conf;

    // 2chID, PWݒǂݍ
    if ($array = P2Util::readIdPw2ch()) {
        list($login2chID, $login2chPW, $autoLogin2ch) = $array;

    } else {
        P2Util::pushInfoHtml("<p>p2 error: 2chOĈ߂IDƃpX[ho^ĉB[<a href=\"login2ch.php\" target=\"subject\">2chOCǗ</a>]</p>");
        return false;
    }

    if ($_conf['2ch_ssl.maru']) {
        $auth2ch_url = 'https://2chv.tora3.net/futen.cgi';
    } else {
        $auth2ch_url = 'http://2chv.tora3.net/futen.cgi';
    }

    $dolib2ch = 'DOLIB/1.00';

    if($_conf['2chapi_use'] == 1) {
        if($_conf['2chapi_appname'] != "") {
            $x_2ch_ua = 'X-2ch-UA: ' . $_conf['2chapi_appname'];
        } else {
            P2Util::pushInfoHtml("<p>p2 error: 2chƒʐM邽߂ɕKvȏ񂪐ݒ肳Ă܂B</p>");
            return false;
        }
    } else {
        $x_2ch_ua = 'X-2ch-UA: ' . P2Commun::getP2UA(false,false);
    }

    try {
        $req = P2Commun::createHTTPRequest($auth2ch_url,HTTP_Request2::METHOD_POST);

        // wb_[
        $req->setHeader('User-Agent', $dolib2ch);
        $req->setHeader('X-2ch-UA', $x_2ch_ua);

        // POSTf[^
        $req->addPostParameter('ID', $login2chID);
        $req->addPostParameter('PW', $login2chPW);
<commit_msg>http_build_urlを導入<commit_after><?php
/**
 * rep2 - 2chOC
 */

// {{{ login2ch()

/**
 * 2ch IDɃOC
 *
 * @return  string|false  2ch SIDԂ
 */
function login2ch()
{
    global $_conf;

    // 2chID, PWݒǂݍ
    if ($array = P2Util::readIdPw2ch()) {
        list($login2chID, $login2chPW, $autoLogin2ch) = $array;

    } else {
        P2Util::pushInfoHtml("<p>p2 error: 2chOĈ߂IDƃpX[ho^ĉB[<a href=\"login2ch.php\" target=\"subject\">2chOCǗ</a>]</p>");
        return false;
    }

    $url = http_build_url(array(
        "scheme" => $_conf['2ch_ssl.maru'] ? "https" : "http",
        "host" => "2chv.tora3.net",
        "path" => "futen.cgi"));

    $dolib2ch = 'DOLIB/1.00';

    if($_conf['2chapi_use'] == 1) {
        if($_conf['2chapi_appname'] != "") {
            $x_2ch_ua = 'X-2ch-UA: ' . $_conf['2chapi_appname'];
        } else {
            P2Util::pushInfoHtml("<p>p2 error: 2chƒʐM邽߂ɕKvȏ񂪐ݒ肳Ă܂B</p>");
            return false;
        }
    } else {
        $x_2ch_ua = 'X-2ch-UA: ' . P2Commun::getP2UA(false,false);
    }

    try {
        $req = P2Commun::createHTTPRequest($auth2ch_url,HTTP_Request2::METHOD_POST);

        // wb_[
        $req->setHeader('User-Agent', $dolib2ch);
        $req->setHeader('X-2ch-UA', $x_2ch_ua);

        // POSTf[^
        $req->addPostParameter('ID', $login2chID);
        $req->addPostParameter('PW', $login2chPW);

{'fraction_non_alphanumeric': 0.20007328691828508, 'fraction_numerical': 0.035910589959692193, 'mean_word_length': 2.442622950819672, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 26, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4585005', 'n_tokens_mistral': 1216, 'n_tokens_neox': 1177, 'n_words': 141}