Changeset 1671400
- Timestamp:
- 06/06/2017 03:00:59 AM (8 years ago)
- Location:
- skt-nurcaptcha
- Files:
-
- 27 added
- 3 edited
-
tags/3.5.0 (added)
-
tags/3.5.0/gpl.txt (added)
-
tags/3.5.0/img (added)
-
tags/3.5.0/img/blackglass.png (added)
-
tags/3.5.0/img/bs_logo_msmall.gif (added)
-
tags/3.5.0/img/clean.png (added)
-
tags/3.5.0/img/dark.png (added)
-
tags/3.5.0/img/icon.svg (added)
-
tags/3.5.0/img/light.png (added)
-
tags/3.5.0/img/red.png (added)
-
tags/3.5.0/img/sfs_banner.jpg (added)
-
tags/3.5.0/img/white.png (added)
-
tags/3.5.0/js (added)
-
tags/3.5.0/js/skt-nurc-functions.js (added)
-
tags/3.5.0/js/skt-nurc-login.js (added)
-
tags/3.5.0/languages (added)
-
tags/3.5.0/languages/skt-nurcaptcha-fr_FR.mo (added)
-
tags/3.5.0/languages/skt-nurcaptcha-fr_FR.po (added)
-
tags/3.5.0/languages/skt-nurcaptcha-nl_NL.mo (added)
-
tags/3.5.0/languages/skt-nurcaptcha-nl_NL.po (added)
-
tags/3.5.0/languages/skt-nurcaptcha.pot (added)
-
tags/3.5.0/readme.txt (added)
-
tags/3.5.0/skt-nurc-admin.php (added)
-
tags/3.5.0/skt-nurc-login-style.css (added)
-
tags/3.5.0/skt-nurc-recaptcha-locales.php (added)
-
tags/3.5.0/skt-nurcaptcha.php (added)
-
tags/3.5.0/uninstall.php (added)
-
trunk/languages/skt-nurcaptcha.pot (modified) (10 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/skt-nurcaptcha.php (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
skt-nurcaptcha/trunk/languages/skt-nurcaptcha.pot
r1323591 r1671400 4 4 "Project-Id-Version: Skt_nurcaptcha 1.0\n" 5 5 "Report-Msgid-Bugs-To: \n" 6 "POT-Creation-Date: 201 6-01-02 21:20-0200\n"6 "POT-Creation-Date: 2017-05-31 21:47-0300\n" 7 7 "PO-Revision-Date: \n" 8 8 "Last-Translator: Carlos Eduardo G. Barbosa <carlos.eduardo@mais.com>\n" … … 17 17 "X-Textdomain-Support: yes\n" 18 18 "X-Poedit-Basepath: ..\n" 19 "X-Generator: Poedit 1.8.6\n"19 "X-Generator: Poedit 2.0.2\n" 20 20 "X-Poedit-SearchPath-0: .\n" 21 21 … … 72 72 msgstr "" 73 73 74 #: skt-nurc-admin.php:210 skt-nurcaptcha.php:24 574 #: skt-nurc-admin.php:210 skt-nurcaptcha.php:246 75 75 msgid "Skt NURCaptcha Settings" 76 76 msgstr "" … … 431 431 msgstr "" 432 432 433 #: skt-nurcaptcha.php:21 3 skt-nurcaptcha.php:559 skt-nurcaptcha.php:602433 #: skt-nurcaptcha.php:214 skt-nurcaptcha.php:578 skt-nurcaptcha.php:621 434 434 msgid "Fill the Captcha below" 435 435 msgstr "" 436 436 437 #: skt-nurcaptcha.php:24 1437 #: skt-nurcaptcha.php:242 438 438 msgid "Skt NURCaptcha Warning" 439 439 msgstr "" 440 440 441 #: skt-nurcaptcha.php:24 3441 #: skt-nurcaptcha.php:244 442 442 msgid "" 443 443 "You must register your reCAPTCHA keys to have Skt NURCaptcha protection " … … 445 445 msgstr "" 446 446 447 #: skt-nurcaptcha.php:24 5447 #: skt-nurcaptcha.php:246 448 448 msgid "Go to" 449 449 msgstr "" 450 450 451 #: skt-nurcaptcha.php:24 5451 #: skt-nurcaptcha.php:246 452 452 msgid "and save your keys to the appropriate fields" 453 453 msgstr "" 454 454 455 #: skt-nurcaptcha.php:24 7455 #: skt-nurcaptcha.php:248 456 456 msgid "Be sure your keys are saved to the appropriate fields down here" 457 457 msgstr "" 458 458 459 #: skt-nurcaptcha.php:2 69459 #: skt-nurcaptcha.php:270 460 460 msgid "reCaptcha ERROR" 461 461 msgstr "" 462 462 463 #: skt-nurcaptcha.php:353 464 msgid "username or email missing" 465 msgstr "" 466 467 #: skt-nurcaptcha.php:398 463 #: skt-nurcaptcha.php:363 464 msgid "username missing" 465 msgstr "" 466 467 #: skt-nurcaptcha.php:367 468 msgid "email missing" 469 msgstr "" 470 471 #: skt-nurcaptcha.php:412 468 472 msgid "Registration Form" 469 473 msgstr "" 470 474 471 #: skt-nurcaptcha.php: 398475 #: skt-nurcaptcha.php:412 472 476 msgid "Register For This Site" 473 477 msgstr "" 474 478 475 #: skt-nurcaptcha.php:4 07479 #: skt-nurcaptcha.php:421 476 480 #, php-format 477 481 msgid "There is a problem with your response: %s" 478 482 msgstr "" 479 483 480 #: skt-nurcaptcha.php:4 19484 #: skt-nurcaptcha.php:433 481 485 msgid "Username" 482 486 msgstr "" 483 487 484 #: skt-nurcaptcha.php:4 24485 msgid "E -mail"486 msgstr "" 487 488 #: skt-nurcaptcha.php:4 34489 msgid " A password will be e-mailed to you."490 msgstr "" 491 492 #: skt-nurcaptcha.php:4 46488 #: skt-nurcaptcha.php:438 489 msgid "Email" 490 msgstr "" 491 492 #: skt-nurcaptcha.php:453 493 msgid "Registration confirmation will be emailed to you." 494 msgstr "" 495 496 #: skt-nurcaptcha.php:465 493 497 msgid "Log in" 494 498 msgstr "" 495 499 496 #: skt-nurcaptcha.php:4 47500 #: skt-nurcaptcha.php:466 497 501 msgid "Lost your password?" 498 502 msgstr "" 499 503 500 #: skt-nurcaptcha.php:5 18504 #: skt-nurcaptcha.php:537 501 505 msgid "" 502 506 "Use only non-accented alphanumeric characters plus these: _ [underscore], " … … 504 508 msgstr "" 505 509 506 #: skt-nurcaptcha.php:5 25510 #: skt-nurcaptcha.php:544 507 511 msgid "" 508 512 "Use a functional email address, as your temporary password will be sent to " … … 510 514 msgstr "" 511 515 512 #: skt-nurcaptcha.php:5 33516 #: skt-nurcaptcha.php:552 513 517 msgid "" 514 518 "To get registered, just transcribe both the words, numbers and signs you see " … … 518 522 msgstr "" 519 523 520 #: skt-nurcaptcha.php:5 38524 #: skt-nurcaptcha.php:557 521 525 msgid "" 522 526 "To get registered, just click on the box below to confirm you're not a spam " … … 528 532 msgstr "" 529 533 530 #: skt-nurcaptcha.php:7 07534 #: skt-nurcaptcha.php:727 531 535 msgid "Could not open socket - server communication failed - try again later." 532 536 msgstr "" 533 537 534 #: skt-nurcaptcha.php:7 60538 #: skt-nurcaptcha.php:780 535 539 #, php-format 536 540 msgid "To use reCAPTCHA you must get an API key from %s" 537 541 msgstr "" 538 542 539 #: skt-nurcaptcha.php:7 65543 #: skt-nurcaptcha.php:785 540 544 msgid "For security reasons, you must pass the remote ip to reCAPTCHA" 541 545 msgstr "" 542 546 543 #: skt-nurcaptcha.php:7 70547 #: skt-nurcaptcha.php:790 544 548 msgid "Inconsistency detected - try again later." 545 549 msgstr "" 546 550 547 #: skt-nurcaptcha.php:7 74551 #: skt-nurcaptcha.php:794 548 552 msgid "Response field was empty!" 549 553 msgstr "" 550 554 551 #: skt-nurcaptcha.php:8 00555 #: skt-nurcaptcha.php:820 552 556 msgid "Incorrect Captcha solution - please try again." 553 557 msgstr "" 554 558 555 #: skt-nurcaptcha.php:8 37559 #: skt-nurcaptcha.php:872 556 560 msgid "error: No return data from query. Try again later." 557 561 msgstr "" 558 562 559 #: skt-nurcaptcha.php:8 41563 #: skt-nurcaptcha.php:877 560 564 msgid "" 561 565 "says: 'Spammer signature found!' Registration will not be allowed for this " … … 563 567 msgstr "" 564 568 565 #: skt-nurcaptcha.php:8 44569 #: skt-nurcaptcha.php:878 566 570 msgid "is suspect" 567 571 msgstr "" 568 572 569 #: skt-nurcaptcha.php:8 45570 msgid " occurrences found"571 msgstr "" 572 573 #: skt-nurcaptcha.php: 881573 #: skt-nurcaptcha.php:883 574 msgid "says: data checked - no spammer! " 575 msgstr "" 576 577 #: skt-nurcaptcha.php:915 574 578 msgid "error: No return data from API query." 575 579 msgstr "" 576 580 577 #: skt-nurcaptcha.php: 888581 #: skt-nurcaptcha.php:922 578 582 #, php-format 579 583 msgid "error: %s" 580 584 msgstr "" 581 585 582 #: skt-nurcaptcha.php:9 04586 #: skt-nurcaptcha.php:938 583 587 msgid "" 584 588 "says: 'Bot signature found!' Registration will not be allowed for this user." 585 589 msgstr "" 586 590 587 #: skt-nurcaptcha.php:10 07591 #: skt-nurcaptcha.php:1041 588 592 msgid "Log table successfully deleted." 589 593 msgstr "" -
skt-nurcaptcha/trunk/readme.txt
r1578191 r1671400 4 4 Tags: security, login form, new user, captcha, spambots, reCAPTCHA, register form, bots, spam, register, anti-spam 5 5 Requires at least: 4.0 6 Tested up to: 4. 77 Stable tag: 3. 4.906 Tested up to: 4.8 7 Stable tag: 3.5.0 8 8 9 9 NURCaptcha inserts a reCAPTCHA on the Register Form of your site to protect it against spambots. … … 85 85 == Changelog == 86 86 87 = 3.5.0 = 88 * Upgrade in antispam databases querying routines and a few other small fixes 87 89 = 3.4.90 = 88 90 * Small adjustments to PHP7 affecting BuddyPress installs … … 163 165 == Upgrade Notice == 164 166 167 = 3.5.0 = 168 * Upgrade in antispam databases querying routines 165 169 = 3.4.90 = 166 170 * Small adjustments to PHP7 affecting BuddyPress installs -
skt-nurcaptcha/trunk/skt-nurcaptcha.php
r1578191 r1671400 4 4 Plugin URI: https://skt-nurcaptcha.sanskritforum.org/ 5 5 Description: If your Blog allows new subscribers to register via the registration option at the Login page, this plugin may be useful to you. It includes a reCaptcha block to the register form, so you get rid of spambots. To use it you have to sign up for (free) public and private keys at <a href="https://www.google.com/recaptcha/admin#createsite" target="_blank">reCAPTCHA API Signup Page</a>. Version 3 added extra security by querying antispam databases for known ip and email of spammers, so you get rid of them even if they break the reCaptcha challenge by solving it as real persons. 6 Version: 3. 4.906 Version: 3.5.0 7 7 Author: Carlos E. G. Barbosa 8 8 Author URI: http://www.yogaforum.org … … 324 324 * Main routine - non-multisite *** 325 325 * This code overrides entirely the 'register' case on main switch @ wp_login.php 326 * we fetch the 'login -form-register' hook326 * we fetch the 'login_form_register' hook 327 327 * You may experience some problems if you install another plugin that needs to customize those lines. 328 328 * … … 331 331 332 332 $http_post = ('POST' == $_SERVER['REQUEST_METHOD']); 333 333 334 if ( is_multisite() ) { 334 // Multisite uses wp-signup.php 335 wp_redirect( apply_filters( 'wp_signup_location', network_site_url('wp-signup.php') ) ); 336 exit(); 337 } 338 339 if ( !get_site_option('users_can_register') ) { 335 /** 336 * Filters the Multisite sign up URL. 337 * 338 * @since 3.0.0 339 * 340 * @param string $sign_up_url The sign up URL. 341 */ 342 wp_redirect( apply_filters( 'wp_signup_location', network_site_url( 'wp-signup.php' ) ) ); 343 exit; 344 } 345 346 if ( !get_option('users_can_register') ) { 340 347 wp_redirect( site_url('wp-login.php?registration=disabled') ); 341 348 exit(); … … 350 357 $errors = NULL; 351 358 if ( $http_post ) { // if we have a response, let's check it 352 $user_login = $_POST['user_login'];353 $user_email = $_POST['user_email'];354 if ( ($user_login =='')||($user_email=='')){359 $user_login = isset( $_POST['user_login'] ) ? $_POST['user_login'] : ''; 360 $user_email = isset( $_POST['user_email'] ) ? $_POST['user_email'] : ''; 361 if ($user_login ==''){ 355 362 $result->is_valid = false; 356 $result->error = __("username or email missing", 'skt-nurcaptcha'); 363 $result->error = __("username missing", 'skt-nurcaptcha'); 364 } 365 if ($user_email==''){ 366 $result->is_valid = false; 367 $result->error = __("email missing", 'skt-nurcaptcha'); 357 368 } 358 369 if ($result->is_valid) { … … 418 429 <?php }else{ ?> 419 430 style="width:300px;" 420 <?php } ?> novalidate ="novalidate">431 <?php } ?> novalidate> 421 432 <p> 422 <label ><?php _e('Username', 'skt-nurcaptcha'); ?><?php nurc_username_help(); ?>433 <label for="user_login"><?php _e('Username'); ?><?php nurc_username_help(); ?> 423 434 <input type="text" name="user_login" id="user_login" class="input" value="<?php echo esc_attr(wp_unslash($user_login)); ?>" size="20" /> 424 435 </label> 425 436 </p> 426 437 <p> 427 <label ><?php _e('E-mail', 'skt-nurcaptcha'); ?><?php nurc_email_help(); ?>438 <label for="user_email"><?php _e('Email'); ?><?php nurc_email_help(); ?> 428 439 <input type="email" name="user_email" id="user_email" class="input" value="<?php echo esc_attr(wp_unslash($user_email)); ?>" size="25" /> 429 440 </label> … … 432 443 <?php 433 444 nurc_recaptcha_challenge(); 445 /** 446 * Fires following the 'Email' field in the user registration form. 447 * 448 * @since 2.1.0 449 */ 434 450 do_action('register_form'); 435 451 ?> 436 452 437 <p id="reg_passmail"><?php _e( 'A password will be e-mailed to you.', 'skt-nurcaptcha'); ?></p>453 <p id="reg_passmail"><?php _e( 'Registration confirmation will be emailed to you.' ); ?></p> 438 454 <br class="clear" /> 439 455 <input type="hidden" name="redirect_to" value="<?php echo esc_attr( $redirect_to ); ?>" /> … … 447 463 448 464 <p id="nav"> 449 <a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in', 'skt-nurcaptcha'); ?></a> |450 <a href="<?php echo esc_url( wp_lostpassword_url() ); ?>" title="<?php esc_attr_e('Password Lost and Found', 'skt-nurcaptcha'); ?>"><?php _e('Lost your password?', 'skt-nurcaptcha'); ?></a>465 <a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in' ); ?></a> | 466 <a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php _e( 'Lost your password?' ); ?></a> 451 467 </p> 452 468 <?php … … 662 678 663 679 if (defined('SKTNURC_BP_ACTIVE')) { 664 $ue = $_POST['signup_email'];665 $ul = $_POST['signup_username'];680 $ue = (isset($_POST['signup_email']))? $_POST['signup_email']: ''; 681 $ul = (isset($_POST['signup_username']))? $_POST['signup_username']: ''; 666 682 }else{ 667 $ue = $_POST['user_email'];683 $ue = (isset($_POST['user_email']))? $_POST['user_email']: ''; 668 684 if ( is_multisite() ) { 669 $ul = $_POST['user_name'];685 $ul = (isset($_POST['user_name']))? $_POST['user_name']: ''; 670 686 }else{ 671 $ul = $_POST['user_login'];687 $ul = (isset($_POST['user_login']))? $_POST['user_login']: ''; 672 688 } 673 689 } … … 827 843 * 828 844 ****/ 829 function skt_nurc_check_stopforumspam($ XMAIL = '', $XIP = '', $XNAME = ''){845 function skt_nurc_check_stopforumspam($email='', $ip='', $username =''){ 830 846 $stopforumspam_response = new nurc_ReCaptchaResponse(); 831 $returned_data=''; $botdata=''; 832 833 $XMAIL = urlencode($XMAIL); // make url compliant with urlencode() 834 $test_string = "http://www.stopforumspam.com/api?ip=$XIP&email=$XMAIL&username=$XNAME"; 835 836 $xmlstr = skt_nurc_get_page($test_string); 837 $xml = simplexml_load_string($xmlstr); 838 839 if($xml->appears[0] == '' || $xml->appears[1] == '' || $xml->appears[2] == ''){ 840 $stopforumspam_response->is_valid = false; 841 $stopforumspam_response->error = 'StopForumSpam '. __("error: No return data from query. Try again later.", 'skt-nurcaptcha').'<strong>'; 842 } 843 if($xml->appears[0] == 'yes' || $xml->appears[1] == 'yes' || $xml->appears[2] == 'yes'){ 844 $stopforumspam_response->is_valid = false; 845 $stopforumspam_response->error = 'StopForumSpam '. __("says: 'Spammer signature found!' Registration will not be allowed for this user ", 'skt-nurcaptcha').'<strong>'; 846 for ($i = 0; $i < 3; $i++) { 847 if($xml->appears[$i] == 'yes'){ 848 $stopforumspam_response->error .= ':: '. $xml->type[$i] . ' ' . __("is suspect", 'skt-nurcaptcha') . ' '; 849 $stopforumspam_response->error .= '[' . $xml->frequency[$i] . ' ' . __("occurrences found", 'skt-nurcaptcha') .'] '; 850 } 851 } 852 $stopforumspam_response->error .= '</strong>'; 853 } else { 854 $stopforumspam_response->is_valid = true; 847 $url = 'http://api.stopforumspam.org/api'; 848 $data = array(); 849 if($email!='') $data['email']=$email; 850 if($ip!='') $data['ip']=$ip; 851 if($username!='') $data['username']=$username; 852 $data = http_build_query($data); 853 854 // init the request, set some info, send it and finally close it 855 $ch = curl_init($url); 856 curl_setopt($ch, CURLOPT_POST, 1); 857 curl_setopt($ch, CURLOPT_POSTFIELDS, $data); 858 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 859 $result = curl_exec($ch); 860 curl_close($ch); 861 862 $xml = simplexml_load_string($result); 863 $rnum = count($xml->appears); 864 if(isset($xml->error)){ 865 $stopforumspam_response->is_valid = false; 866 $stopforumspam_response->error = 'StopForumSpam '. $xml->error[0]; 867 return $stopforumspam_response; 868 } 869 for($i=0;$i<$rnum;$i++){ 870 if($xml->appears[$i] == ''){ 871 $stopforumspam_response->is_valid = false; 872 $stopforumspam_response->error = 'StopForumSpam '. __("error: No return data from query. Try again later.", 'skt-nurcaptcha').'<strong>'; 873 break; 874 } 875 if($xml->appears[$i] == 'yes'){ 876 $stopforumspam_response->is_valid = false; 877 $stopforumspam_response->error = 'StopForumSpam '. __("says: 'Spammer signature found!' Registration will not be allowed for this user ", 'skt-nurcaptcha').'<strong>'; 878 $stopforumspam_response->error .= ':: '. $xml->type[$i] . ' ' . __("is suspect", 'skt-nurcaptcha') . ' '; 879 $stopforumspam_response->error .= '</strong>'; 880 break; 881 } else { 882 $stopforumspam_response->is_valid = true; 883 $stopforumspam_response->error = 'StopForumSpam '. __("says: data checked - no spammer! ", 'skt-nurcaptcha'); 884 } 855 885 } 856 886 return $stopforumspam_response; 857 887 858 888 } // here ends: function skt_nurc_check_stopforumspam() 859 889 … … 867 897 $returned_data=''; $botdata=''; 868 898 $APIKEY = get_site_option('sktnurc_botscoutKey'); 869 870 $XMAIL = urlencode($XMAIL); // make url compliant with urlencode() 871 if ($XNAME == ''){ 872 $test_string = "http://botscout.com/test/?multi&mail=$XMAIL";873 }else{ 874 $test_string = "http://botscout.com/test/?multi&name=$XNAME&mail=$XMAIL";875 }876 if(get_site_option('sktnurc_botscoutTestMode')==false){$test_string .= "&ip=$XIP";} 877 if($APIKEY != ''){ // append API key. 878 $test_string .= "&key=$APIKEY";879 } 880 899 900 $test_string = "http://botscout.com/test/?"; 901 $data = array(); 902 if($email!='') $data['mail']=$email; 903 if(($ip!='')&&(get_site_option('sktnurc_botscoutTestMode')=='false')) $data['ip']=$ip; 904 if($username!='') $data['name']=$username; 905 if($APIKEY != '') $data['key']= $APIKEY; 906 $query = http_build_query($data); 907 $query = (count($data)>1)? 'multi&'.$query:$query; 908 $test_string .= $query; 909 910 881 911 $returned_data = skt_nurc_get_page($test_string); 882 912 883 913 if($returned_data==''){ 884 $botscout_response->is_valid = false;914 $botscout_response->is_valid = true; // no answer from botscout - so, drop the test 885 915 $botscout_response->error = 'BotScout ' . __("error: No return data from API query.", 'skt-nurcaptcha'); 886 916 return $botscout_response; … … 889 919 if(substr($returned_data, 0,1) == '!'){ 890 920 // the first character is an exclamation mark, an error occurred! 891 $botscout_response->is_valid = false;921 $botscout_response->is_valid = true; // botscout site failed to answer, so, drop the test 892 922 $botscout_response->error = 'BotScout ' . sprintf(__("error: %s", 'skt-nurcaptcha'),$returned_data); 893 923 return $botscout_response; … … 1012 1042 } 1013 1043 } 1014 /************ 1015 * This method solves the problem of server restrictions on getting external url contents 1016 * such as the responses given by antispam databases 1017 * Thanks to Greg on (http://www.bugz.com.br/2011/09/file_get_contents/) [pt_BR] 1018 *************/ 1019 function skt_nurc_get_page($url, $referer='', $timeout=30, $header=''){ 1020 if ($referer=='') $referer='http://'.$_SERVER['HTTP_HOST']; 1021 if(!isset($timeout)) $timeout=30; 1022 $curl = curl_init(); 1023 if(strstr($referer,"://")){ 1024 curl_setopt ($curl, CURLOPT_REFERER, $referer); 1025 } 1026 curl_setopt ($curl, CURLOPT_URL, $url); 1027 curl_setopt ($curl, CURLOPT_TIMEOUT, $timeout); 1028 curl_setopt ($curl, CURLOPT_USERAGENT, sprintf("Mozilla/%d.0",rand(4,5))); 1029 curl_setopt ($curl, CURLOPT_HEADER, (int)$header); 1030 curl_setopt ($curl, CURLOPT_RETURNTRANSFER, 1); 1031 curl_setopt ($curl, CURLOPT_SSL_VERIFYPEER, 0); 1032 $html = curl_exec ($curl); 1033 curl_close ($curl); 1034 return $html; 1035 } 1044 /** 1045 * Send a GET request using cURL 1046 * @param string $url to request 1047 * @param array $get values to send 1048 * @param array $options for cURL 1049 * @return string 1050 */ 1051 function skt_nurc_get_page($url, array $get = null, array $options = array()){ 1052 if($get !== null) $url = $url. (strpos($url, '?') === FALSE ? '?' : ''). http_build_query($get); 1053 $protocol = ($_SERVER['HTTPS'])? 'https':'http'; 1054 $referer= $protocol.'://'.$_SERVER['HTTP_HOST']; 1055 $defaults = array( 1056 CURLOPT_URL => $url, 1057 CURLOPT_USERAGENT => 'Mozilla/5.0', 1058 CURLOPT_HEADER => 0, 1059 CURLOPT_RETURNTRANSFER => TRUE, 1060 CURLOPT_TIMEOUT => 30, 1061 CURLOPT_SSL_VERIFYPEER => false, 1062 CURLOPT_REFERER => $referer 1063 ); 1064 $ch = curl_init(); 1065 curl_setopt_array($ch, ($options + $defaults)); 1066 if( ! $result = curl_exec($ch)) $result =''; 1067 curl_close($ch); 1068 return $result; 1069 } 1036 1070 /*************** 1037 1071 * This method derived from one published by Manish Zope, as a comment at:
Note: See TracChangeset
for help on using the changeset viewer.