Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mantisbt/mantisbt
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: c61090415514
Choose a base ref
...
head repository: mantisbt/mantisbt
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 8c2bd07f9bbd
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Apr 26, 2013

  1. 2

    Verified

    This commit was signed with the committer’s verified signature.
    Doctor-wu Doctor Wu
    Copy the full SHA
    8df9d5f View commit details
  2. Copy the full SHA
    8c2bd07 View commit details
Showing with 18 additions and 4 deletions.
  1. +4 −1 core/email_queue_api.php
  2. +14 −3 core/url_api.php
5 changes: 4 additions & 1 deletion core/email_queue_api.php
Original file line number Diff line number Diff line change
@@ -99,8 +99,11 @@ function email_queue_add( $p_email_data ) {
" . db_param() . "
)";
db_query_bound( $query, Array( $c_email, $c_subject, $c_body, db_now(), $c_metadata ) );
$t_id = db_insert_id( $t_email_table, 'email_id' );

return db_insert_id( $t_email_table, 'email_id' );
log_event( LOG_EMAIL, "message #$t_id queued" );

return $t_id;
}

/**
17 changes: 14 additions & 3 deletions core/url_api.php
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@

/**
* Retrieve the contents of a remote URL.
* First tries using built-in PHP modules (OpenSSL and cURL), then attempts
* First tries using built-in PHP modules (OpenSSL and cURL), then attempts
* system call as last resort.
* @param string URL
* @return null|string URL contents (NULL in case of errors)
@@ -47,11 +47,22 @@ function url_get( $p_url ) {
# Use the PHP cURL extension
if( function_exists( 'curl_init' ) ) {
$t_curl = curl_init( $p_url );
curl_setopt( $t_curl, CURLOPT_RETURNTRANSFER, true );
# @todo It may be useful to provide users a way to define additional

# cURL options
$t_curl_opt[CURLOPT_RETURNTRANSFER] = true;

# @todo It may be useful to provide users a way to define additional
# custom options for curl module, e.g. proxy settings and authentication.
# This could be stored in a global config option.

# Default User Agent (matching cmdline curl's behavior)
$t_vers = curl_version();
$t_curl_opt[CURLOPT_USERAGENT] = 'curl/' . $t_vers['version'];

# Set the options
curl_setopt_array( $t_curl, $t_curl_opt );

# Retrieve data
$t_data = curl_exec( $t_curl );
curl_close( $t_curl );