Changeset 21514 for branches/version-2_12-dev/data/class/util/SC_Utils.php
- Timestamp:
- 2012/02/15 19:56:17 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/util/SC_Utils.php
r21490 r21514 68 68 69 69 if (SC_Utils_Ex::sfIsHTTPS()) { 70 $proto = "https://";71 } else { 72 $proto = "http://";70 $proto = 'https://'; 71 } else { 72 $proto = 'http://'; 73 73 } 74 74 $host = $proto . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT']; … … 124 124 $GLOBAL_ERR.= '<div id="errorHeader">'; 125 125 $GLOBAL_ERR.= $mess; 126 $GLOBAL_ERR.= "</div>";126 $GLOBAL_ERR.= '</div>'; 127 127 if ($print) { 128 128 echo $GLOBAL_ERR; … … 144 144 145 145 /* サイトエラーページの表示 */ 146 function sfDispSiteError($type, $objSiteSess = "", $return_top = false, $err_msg = "") {146 function sfDispSiteError($type, $objSiteSess = '', $return_top = false, $err_msg = '') { 147 147 148 148 require_once CLASS_EX_REALDIR . 'page_extends/error/LC_Page_Error_Ex.php'; … … 221 221 */ 222 222 function sfPassLen($passlen) { 223 $ret = "";223 $ret = ''; 224 224 for ($i=0;$i<$passlen;true) { 225 $ret.= "*";225 $ret.='*'; 226 226 $i++; 227 227 } … … 262 262 /* DB用日付文字列取得 */ 263 263 function sfGetTimestamp($year, $month, $day, $last = false) { 264 if ($year != "" && $month != ""&& $day != "") {264 if ($year != '' && $month != '' && $day != "") { 265 265 if ($last) { 266 $time = "23:59:59";266 $time = '23:59:59'; 267 267 } else { 268 $time = "00:00:00";269 } 270 $date = $year. "-".$month."-".$day." ".$time;271 } else { 272 $date = "";268 $time = '00:00:00'; 269 } 270 $date = $year.'-'.$month.'-'.$day." ".$time; 271 } else { 272 $date = ''; 273 273 } 274 274 return $date; … … 303 303 } 304 304 305 function sfGetCSVData($data, $prefix = "") {306 if ($prefix == "") {305 function sfGetCSVData($data, $prefix = '') { 306 if ($prefix == '') { 307 307 $dir_name = SC_Utils_Ex::sfUpDirName(); 308 $file_name = $dir_name . date('ymdHis') . ".csv";309 } else { 310 $file_name = $prefix . date('ymdHis') . ".csv";308 $file_name = $dir_name . date('ymdHis') .'.csv'; 309 } else { 310 $file_name = $prefix . date('ymdHis') .'.csv'; 311 311 } 312 312 … … 322 322 function sfUpDirName() { 323 323 $path = $_SERVER['PHP_SELF']; 324 $arrVal = explode( "/", $path);324 $arrVal = explode('/', $path); 325 325 $cnt = count($arrVal); 326 326 return $arrVal[($cnt - 2)]; … … 332 332 */ 333 333 function sfMergeCBValue($keyname, $max) { 334 $conv = "";334 $conv = ''; 335 335 $cnt = 1; 336 336 for ($cnt = 1; $cnt <= $max; $cnt++) { … … 349 349 */ 350 350 function sfMergeCheckBoxes($array, $max) { 351 $ret = "";351 $ret = ''; 352 352 if (is_array($array)) { 353 353 foreach ($array as $val) { … … 373 373 if (is_array($array)) { 374 374 foreach ($array as $val) { 375 if ($ret != "") {375 if ($ret != '') { 376 376 $ret.= "-$val"; 377 377 } else { … … 421 421 */ 422 422 function sfMergeCBSearchValue($keyname, $max) { 423 $conv = "";423 $conv = ''; 424 424 $cnt = 1; 425 425 for ($cnt = 1; $cnt <= $max; $cnt++) { … … 437 437 * @deprecated 438 438 */ 439 function sfSplitCBValue($val, $keyname = "") {439 function sfSplitCBValue($val, $keyname = '') { 440 440 $arr = array(); 441 441 $len = strlen($val); 442 442 $no = 1; 443 443 for ($cnt = 0; $cnt < $len; $cnt++) { 444 if ($keyname != "") {444 if ($keyname != '') { 445 445 $arr[$keyname . $no] = substr($val, $cnt, 1); 446 446 } else { … … 453 453 454 454 // キーと値をセットした配列を取得 455 function sfArrKeyValue($arrList, $keyname, $valname, $len_max = "", $keysize = "") {455 function sfArrKeyValue($arrList, $keyname, $valname, $len_max = '', $keysize = '') { 456 456 $arrRet = array(); 457 457 $max = count($arrList); 458 458 459 if ($len_max != ""&& $max > $len_max) {459 if ($len_max != '' && $max > $len_max) { 460 460 $max = $len_max; 461 461 } 462 462 463 463 for ($cnt = 0; $cnt < $max; $cnt++) { 464 if ($keysize != "") {464 if ($keysize != '') { 465 465 $key = SC_Utils_Ex::sfCutString($arrList[$cnt][$keyname], $keysize); 466 466 } else { … … 478 478 479 479 // キーと値をセットした配列を取得(値が複数の場合) 480 function sfArrKeyValues($arrList, $keyname, $valname, $len_max = "", $keysize = "", $connect = "") {480 function sfArrKeyValues($arrList, $keyname, $valname, $len_max = '', $keysize = '', $connect = "") { 481 481 482 482 $max = count($arrList); 483 483 484 if ($len_max != ""&& $max > $len_max) {484 if ($len_max != '' && $max > $len_max) { 485 485 $max = $len_max; 486 486 } 487 487 488 488 for ($cnt = 0; $cnt < $max; $cnt++) { 489 if ($keysize != "") {489 if ($keysize != '') { 490 490 $key = SC_Utils_Ex::sfCutString($arrList[$cnt][$keyname], $keysize); 491 491 } else { … … 494 494 $val = $arrList[$cnt][$valname]; 495 495 496 if ($connect != "") {496 if ($connect != '') { 497 497 $arrRet[$key].= "$val".$connect; 498 498 } else { … … 506 506 function sfGetCommaList($array, $space=true, $arrPop = array()) { 507 507 if (count($array) > 0) { 508 $line = "";508 $line = ''; 509 509 foreach ($array as $val) { 510 510 if (!in_array($val, $arrPop)) { 511 511 if ($space) { 512 $line .= $val . ", ";512 $line .= $val . ', '; 513 513 } else { 514 $line .= $val . ",";514 $line .= $val . ','; 515 515 } 516 516 } … … 530 530 /* 配列の要素をCSVフォーマットで出力する。*/ 531 531 function sfGetCSVList($array) { 532 $line = "";532 $line = ''; 533 533 if (count($array) > 0) { 534 534 foreach ($array as $key => $val) { … … 565 565 } 566 566 if (! $error) { 567 $date1 = $start_year . "/".sprintf("%02d",$start_month) ."/".sprintf("%02d",$start_day) ." 000000";568 $date2 = $end_year . "/".sprintf("%02d",$end_month) ."/".sprintf("%02d",$end_day) ." 235959";567 $date1 = $start_year .'/'.sprintf('%02d',$start_month) ."/".sprintf("%02d",$start_day) ." 000000"; 568 $date2 = $end_year .'/'.sprintf('%02d',$end_month) ."/".sprintf("%02d",$end_day) ." 235959"; 569 569 if ($date1 > $date2) $error = 3; 570 570 } else { … … 590 590 591 591 function sfGetErrorColor($val) { 592 if ($val != "") {593 return "background-color:". ERR_COLOR;594 } 595 return "";592 if ($val != '') { 593 return 'background-color:' . ERR_COLOR; 594 } 595 return ''; 596 596 } 597 597 … … 600 600 return " disabled=\"disabled\""; 601 601 } 602 return "";602 return ''; 603 603 } 604 604 … … 607 607 return "checked=\"checked\""; 608 608 } 609 return "";609 return ''; 610 610 } 611 611 … … 681 681 682 682 /* ポイント付与 */ 683 function sfPrePoint($price, $point_rate, $rule = POINT_RULE, $product_id = "") {683 function sfPrePoint($price, $point_rate, $rule = POINT_RULE, $product_id = '') { 684 684 $real_point = $point_rate / 100; 685 685 $ret = $price * $real_point; … … 707 707 /* 規格分類の件数取得 */ 708 708 function sfGetClassCatCount() { 709 $sql = "select count(dtb_class.class_id) as count, dtb_class.class_id ";710 $sql.= "from dtb_class inner join dtb_classcategory on dtb_class.class_id = dtb_classcategory.class_id ";711 $sql.= "where dtb_class.del_flg = 0 AND dtb_classcategory.del_flg = 0 ";712 $sql.= "group by dtb_class.class_id, dtb_class.name";709 $sql = 'select count(dtb_class.class_id) as count, dtb_class.class_id '; 710 $sql.= 'from dtb_class inner join dtb_classcategory on dtb_class.class_id = dtb_classcategory.class_id '; 711 $sql.= 'where dtb_class.del_flg = 0 AND dtb_classcategory.del_flg = 0 '; 712 $sql.= 'group by dtb_class.class_id, dtb_class.name'; 713 713 $objQuery = new SC_Query_Ex(); 714 714 $arrList = $objQuery->getAll($sql); … … 720 720 721 721 function sfGetProductClassId($product_id, $classcategory_id1, $classcategory_id2) { 722 $where = "product_id = ?";722 $where = 'product_id = ?'; 723 723 $objQuery = new SC_Query_Ex(); 724 724 $ret = $objQuery->get('product_class_id', 'dtb_products_class', $where, Array($product_id)); … … 734 734 /* DBから取り出した日付の文字列を調整する。*/ 735 735 function sfDispDBDate($dbdate, $time = true) { 736 list($y, $m, $d, $H, $M) = preg_split( "/[- :]/", $dbdate);736 list($y, $m, $d, $H, $M) = preg_split('/[- :]/', $dbdate); 737 737 738 738 if (strlen($y) > 0 && strlen($m) > 0 && strlen($d) > 0) { 739 739 if ($time) { 740 $str = sprintf( "%04d/%02d/%02d %02d:%02d", $y, $m, $d, $H, $M);740 $str = sprintf('%04d/%02d/%02d %02d:%02d', $y, $m, $d, $H, $M); 741 741 } else { 742 $str = sprintf( "%04d/%02d/%02d", $y, $m, $d, $H, $M);743 } 744 } else { 745 $str = "";742 $str = sprintf('%04d/%02d/%02d', $y, $m, $d, $H, $M); 743 } 744 } else { 745 $str = ''; 746 746 } 747 747 return $str; … … 816 816 817 817 /* 一意かつ予測されにくいID */ 818 function sfGetUniqRandomId($head = "") {818 function sfGetUniqRandomId($head = '') { 819 819 // 予測されないようにランダム文字列を付与する。 820 820 $random = GC_Utils_Ex::gfMakePassword(8); … … 826 826 // 二回以上繰り返されているスラッシュ[/]を一つに変換する。 827 827 function sfRmDupSlash($istr) { 828 if (ereg( "^http://", $istr)) {828 if (ereg('^http://', $istr)) { 829 829 $str = substr($istr, 7); 830 $head = "http://";831 } else if (ereg( "^https://", $istr)) {830 $head = 'http://'; 831 } else if (ereg('^https://', $istr)) { 832 832 $str = substr($istr, 8); 833 $head = "https://";833 $head = 'https://'; 834 834 } else { 835 835 $str = $istr; 836 836 } 837 $str = ereg_replace( "[/]+", "/", $str);837 $str = ereg_replace('[/]+', '/', $str); 838 838 $ret = $head . $str; 839 839 return $ret; … … 866 866 $outpath = $out_dir . 'enc_' . $basename; 867 867 868 $ofp = fopen($outpath, "w+");868 $ofp = fopen($outpath, 'w+'); 869 869 870 870 while (!feof($ifp)) { … … 927 927 928 928 if ($commadisp) { 929 $ret = $ret . "...";929 $ret = $ret . '...'; 930 930 } 931 931 return $ret; … … 971 971 972 972 // 日付の作成 973 $start_date = sprintf( "%d/%d/%d 00:00:00", $start_year, $start_month, $start_day);974 $end_date = sprintf( "%d/%d/%d 23:59:59", $end_year, $end_month, $end_day);973 $start_date = sprintf('%d/%d/%d 00:00:00', $start_year, $start_month, $start_day); 974 $end_date = sprintf('%d/%d/%d 23:59:59', $end_year, $end_month, $end_day); 975 975 976 976 return array($start_date, $end_date); … … 978 978 979 979 // 再帰的に多段配列を検索して一次元配列(Hidden引渡し用配列)に変換する。 980 function sfMakeHiddenArray($arrSrc, $arrDst = array(), $parent_key = "") {980 function sfMakeHiddenArray($arrSrc, $arrDst = array(), $parent_key = '') { 981 981 if (is_array($arrSrc)) { 982 982 foreach ($arrSrc as $key => $val) { 983 if ($parent_key != "") {984 $keyname = $parent_key . "[". $key . "]";983 if ($parent_key != '') { 984 $keyname = $parent_key . '['. $key . ']'; 985 985 } else { 986 986 $keyname = $key; … … 1108 1108 1109 1109 // ディレクトリ以下のファイルを再帰的にコピー 1110 function sfCopyDir($src, $des, $mess = "", $override = false) {1110 function sfCopyDir($src, $des, $mess = '', $override = false) { 1111 1111 if (!is_dir($src)) { 1112 1112 return false; … … 1123 1123 } 1124 1124 1125 $fileArray=glob($src. "*");1125 $fileArray=glob($src.'*'); 1126 1126 if (is_array($fileArray)) { 1127 1127 foreach ($fileArray as $key => $data_) { 1128 1128 // CVS管理ファイルはコピーしない 1129 if (ereg( "/CVS/Entries", $data_)) {1129 if (ereg('/CVS/Entries', $data_)) { 1130 1130 break; 1131 1131 } 1132 if (ereg( "/CVS/Repository", $data_)) {1132 if (ereg('/CVS/Repository', $data_)) { 1133 1133 break; 1134 1134 } 1135 if (ereg( "/CVS/Root", $data_)) {1135 if (ereg('/CVS/Root', $data_)) { 1136 1136 break; 1137 1137 } … … 1165 1165 // フォルダ内のファイルを削除 1166 1166 while ($file = readdir($dh)) { 1167 if ($file == "." or $file == "..") continue;1168 $del_file = $dir . "/". $file;1167 if ($file == '.' or $file == '..') continue; 1168 $del_file = $dir . '/' . $file; 1169 1169 if (is_file($del_file)) { 1170 $ret = unlink($dir . "/". $file);1170 $ret = unlink($dir . '/' . $file); 1171 1171 }else if (is_dir($del_file)) { 1172 1172 $ret = SC_Utils_Ex::sfDelFile($del_file); … … 1195 1195 * 説明 :ファイル書き出し 1196 1196 */ 1197 function sfWriteFile($str, $path, $type, $permission = "") {1197 function sfWriteFile($str, $path, $type, $permission = '') { 1198 1198 //ファイルを開く 1199 1199 if (!($file = fopen ($path, $type))) { … … 1210 1210 fclose ($file); 1211 1211 // 権限を指定 1212 if ($permission != "") {1212 if ($permission != '') { 1213 1213 chmod($path, $permission); 1214 1214 } … … 1251 1251 while (!feof($src_fp)) { 1252 1252 $line = fgets($src_fp); 1253 if (ereg( "@version", $line)) {1254 $arrLine = explode( " ", $line);1253 if (ereg('@version', $line)) { 1254 $arrLine = explode(' ', $line); 1255 1255 $version = $arrLine[5]; 1256 1256 } … … 1288 1288 function arrayDefineIndexes($array, $defineIndexes) { 1289 1289 foreach ($defineIndexes as $key) { 1290 if (!isset($array[$key])) $array[$key] = "";1290 if (!isset($array[$key])) $array[$key] = ''; 1291 1291 } 1292 1292 return $array; … … 1319 1319 function printXMLDeclaration() { 1320 1320 $ua = $_SERVER['HTTP_USER_AGENT']; 1321 if (!preg_match( "/MSIE/", $ua) || preg_match("/MSIE 7/", $ua)) {1321 if (!preg_match('/MSIE/', $ua) || preg_match('/MSIE 7/', $ua)) { 1322 1322 echo '<?xml version="1.0" encoding="' . CHAR_CODE . '"?>' . "\n"; 1323 1323 } … … 1343 1343 foreach ($arrDir as $file) { 1344 1344 // ./ と ../を除くファイルのみを取得 1345 if ($file != "." && $file != "..") {1346 1347 $path = $dir. "/".$file;1345 if ($file != '.' && $file != '..') { 1346 1347 $path = $dir.'/'.$file; 1348 1348 // SELECT内の見た目を整えるため指定文字数で切る 1349 1349 $file_name = SC_Utils_Ex::sfCutString($file, FILE_NAME_LEN); 1350 1350 $file_size = SC_Utils_Ex::sfCutString(SC_Utils_Ex::sfGetDirSize($path), FILE_NAME_LEN); 1351 $file_time = date( "Y/m/d", filemtime($path));1351 $file_time = date('Y/m/d', filemtime($path)); 1352 1352 1353 1353 // ディレクトリとファイルで格納配列を変える … … 1389 1389 // 行末の/を取り除く 1390 1390 $dir = ereg_replace("/$", "", $dir); 1391 $path = $dir. "/".$file;1391 $path = $dir.'/'.$file; 1392 1392 if ($file != '..' && $file != '.' && !is_dir($path)) { 1393 1393 $bytes += filesize($path); … … 1403 1403 } 1404 1404 // ディレクトリ(ファイル)が存在しない場合は0byteを返す 1405 if($bytes == "") $bytes = 0;1405 if($bytes == '') $bytes = 0; 1406 1406 1407 1407 return $bytes; … … 1460 1460 natcasesort($arrDir); 1461 1461 foreach ($arrDir as $item) { 1462 if ($item != "." && $item != "..") {1462 if ($item != '.' && $item != '..') { 1463 1463 // 文末の/を取り除く 1464 1464 $dir = ereg_replace("/$", "", $dir); 1465 $path = $dir. "/".$item;1465 $path = $dir.'/'.$item; 1466 1466 // ディレクトリのみ取得 1467 1467 if (is_dir($path)) { … … 1503 1503 // 行末の/を取り除く 1504 1504 $dir = ereg_replace("/$", "", $dir); 1505 $path = $dir. "/".$file;1505 $path = $dir.'/'.$file; 1506 1506 if ($file != '..' && $file != '.' && is_dir($path)) { 1507 1507 return true; … … 1536 1536 function sfDownloadFile($file) { 1537 1537 // ファイルの場合はダウンロードさせる 1538 Header( "Content-disposition: attachment; filename=".basename($file));1539 Header( "Content-type: application/octet-stream; name=".basename($file));1540 Header( "Cache-Control: ");1541 Header( "Pragma: ");1538 Header('Content-disposition: attachment; filename='.basename($file)); 1539 Header('Content-type: application/octet-stream; name='.basename($file)); 1540 Header('Cache-Control: '); 1541 Header('Pragma: '); 1542 1542 echo (sfReadFile($file)); 1543 1543 } … … 1549 1549 * 説明 :ファイル作成 1550 1550 */ 1551 function sfCreateFile($file, $mode = "") {1551 function sfCreateFile($file, $mode = '') { 1552 1552 // 行末の/を取り除く 1553 if ($mode != "") {1553 if ($mode != '') { 1554 1554 $ret = @mkdir($file, $mode); 1555 1555 } else { … … 1566 1566 */ 1567 1567 function sfReadFile($filename) { 1568 $str = "";1568 $str = ''; 1569 1569 // バイナリモードでオープン 1570 1570 $fp = @fopen($filename, 'rb'); … … 1588 1588 if (is_array($arrayIndex) && 0 < count($arrayIndex)) { 1589 1589 for ($j = 0; $j < count($arrayIndex); $j++) { 1590 if ($j > 0) $return .= ",";1590 if ($j > 0) $return .= ','; 1591 1591 $return .= "\""; 1592 $return .= mb_ereg_replace( "<","<",mb_ereg_replace("\"","\"\"",$array[$i][$arrayIndex[$j]])) ."\"";1592 $return .= mb_ereg_replace('<','<',mb_ereg_replace("\"","\"\"",$array[$i][$arrayIndex[$j]])) ."\""; 1593 1593 } 1594 1594 } else { 1595 1595 for ($j = 0; $j < count($array[$i]); $j++) { 1596 if ($j > 0) $return .= ",";1596 if ($j > 0) $return .= ','; 1597 1597 $return .= "\""; 1598 $return .= mb_ereg_replace( "<","<",mb_ereg_replace("\"","\"\"",$array[$i][$j])) ."\"";1598 $return .= mb_ereg_replace('<','<',mb_ereg_replace("\"","\"\"",$array[$i][$j])) ."\""; 1599 1599 } 1600 1600 } … … 1610 1610 */ 1611 1611 function getTableTag($array) { 1612 $html = "<table>";1613 $html.= "<tr>";1612 $html = '<table>'; 1613 $html.= '<tr>'; 1614 1614 foreach ($array[0] as $key => $val) { 1615 1615 $html.="<th>$key</th>"; 1616 1616 } 1617 $html.= "</tr>";1617 $html.= '</tr>'; 1618 1618 1619 1619 $cnt = count($array); 1620 1620 1621 1621 for ($i = 0; $i < $cnt; $i++) { 1622 $html.= "<tr>";1622 $html.= '<tr>'; 1623 1623 foreach ($array[$i] as $val) { 1624 1624 $html.="<td>$val</td>"; 1625 1625 } 1626 $html.= "</tr>";1626 $html.= '</tr>'; 1627 1627 } 1628 1628 return $html; … … 1684 1684 1685 1685 if (SC_Utils_Ex::sfIsHTTPS()) { 1686 $url = "https://";1687 } else { 1688 $url = "http://";1686 $url = 'https://'; 1687 } else { 1688 $url = 'http://'; 1689 1689 } 1690 1690 … … 1709 1709 } 1710 1710 1711 $string .= $backtrace['file'] . " ". $backtrace['line'] . ":" . $func . "\n";1711 $string .= $backtrace['file'] . ' ' . $backtrace['line'] . ":" . $func . "\n"; 1712 1712 } 1713 1713 … … 1754 1754 // 郵便番号検索文作成 1755 1755 $zipcode = mb_convert_kana($zipcode ,'n'); 1756 $sqlse = "SELECT state, city, town FROM mtb_zip WHERE zipcode = ?";1756 $sqlse = 'SELECT state, city, town FROM mtb_zip WHERE zipcode = ?'; 1757 1757 1758 1758 $data_list = $objQuery->getAll($sqlse, array($zipcode)); … … 1767 1767 $town = $data_list[0]['town']; 1768 1768 $town = ereg_replace("(.*)$","",$town); 1769 $town = ereg_replace( "以下に掲載がない場合","",$town);1769 $town = ereg_replace('以下に掲載がない場合','',$town); 1770 1770 $data_list[0]['town'] = $town; 1771 1771 $data_list[0]['state'] = $arrREV_PREF[$data_list[0]['state']]; … … 1876 1876 $microtime = microtime(true); 1877 1877 if (is_string($microtime)) { 1878 list($usec, $sec) = explode( " ", microtime());1878 list($usec, $sec) = explode(' ', microtime()); 1879 1879 return (float)$usec + (float)$sec; 1880 1880 } … … 1887 1887 * 引数 $val が空白かどうかをチェックする. 空白の場合は true. 1888 1888 * 以下の文字は空白と判断する. 1889 * - " "(ASCII 32 (0x20)), 通常の空白1889 * - ' ' (ASCII 32 (0x20)), 通常の空白 1890 1890 * - "\t" (ASCII 9 (0x09)), タブ 1891 1891 * - "\n" (ASCII 10 (0x0A)), リターン … … 1900 1900 * 1901 1901 * @param mixed $val チェック対象の変数 1902 * @param boolean $greedy "貧欲"にチェックを行う場合 true1902 * @param boolean $greedy '貧欲'にチェックを行う場合 true 1903 1903 * @return boolean $val が空白と判断された場合 true 1904 1904 */ … … 1927 1927 1928 1928 if ($greedy) { 1929 $val = preg_replace( "/ /", "", $val);1929 $val = preg_replace('/ /', '', $val); 1930 1930 } 1931 1931 … … 1949 1949 $host = $netURL->host; 1950 1950 if (!$host) return false; 1951 $host = preg_quote($host, "#");1951 $host = preg_quote($host, '#'); 1952 1952 if (!preg_match("#^(http|https)://{$host}#i", $url)) return false; 1953 1953 return true; … … 1969 1969 $res = $str; 1970 1970 } else { 1971 $res = hash_hmac(PASSWORD_HASH_ALGOS, $str . ":". AUTH_MAGIC, $salt);1971 $res = hash_hmac(PASSWORD_HASH_ALGOS, $str . ':' . AUTH_MAGIC, $salt); 1972 1972 } 1973 1973 return $res; … … 1992 1992 if (empty($salt)) { 1993 1993 // 旧バージョン(2.11未満)からの移行を考慮 1994 $hash = sha1($pass . ":". AUTH_MAGIC);1994 $hash = sha1($pass . ':' . AUTH_MAGIC); 1995 1995 } else { 1996 1996 $hash = SC_Utils_Ex::sfGetHashString($pass, $salt); … … 2144 2144 // 対象が存在するかを検証. 2145 2145 if (file_exists($path) === false) { 2146 GC_Utils_Ex::gfPrintLog($path . " が存在しません.");2146 GC_Utils_Ex::gfPrintLog($path . ' が存在しません.'); 2147 2147 } elseif (is_dir($path)) { 2148 2148 // ディレクトリが指定された場合 2149 2149 $handle = opendir($path); 2150 2150 if (!$handle) { 2151 GC_Utils_Ex::gfPrintLog($path . " が開けませんでした.");2151 GC_Utils_Ex::gfPrintLog($path . ' が開けませんでした.'); 2152 2152 } 2153 2153 while (($item = readdir($handle)) !== false) { … … 2164 2164 closedir($handle); 2165 2165 // ディレクトリを削除 2166 GC_Utils_Ex::gfPrintLog($path . " を削除します.");2166 GC_Utils_Ex::gfPrintLog($path . ' を削除します.'); 2167 2167 if ($del_myself) { 2168 2168 $flg = @rmdir($path); … … 2170 2170 } else { 2171 2171 // ファイルが指定された場合. 2172 GC_Utils_Ex::gfPrintLog($path . " を削除します.");2172 GC_Utils_Ex::gfPrintLog($path . ' を削除します.'); 2173 2173 $flg = @unlink($path); 2174 2174 }
Note: See TracChangeset
for help on using the changeset viewer.