From 3f643e678ef64ae29aa9720aef9b2a40496a5343 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 27 Oct 2006 06:25:31 +0000 Subject: --- system/database/drivers/oci8/oci8_result.php | 16 +++--- system/libraries/Email.php | 74 +++++++++++++--------------- system/libraries/Output.php | 3 +- user_guide/changelog.html | 8 ++- user_guide/libraries/file_uploading.html | 2 +- user_guide/nav/nav.js | 1 + 6 files changed, 46 insertions(+), 58 deletions(-) diff --git a/system/database/drivers/oci8/oci8_result.php b/system/database/drivers/oci8/oci8_result.php index 947a76109..efb2f7bed 100644 --- a/system/database/drivers/oci8/oci8_result.php +++ b/system/database/drivers/oci8/oci8_result.php @@ -38,18 +38,14 @@ class CI_DB_oci8_result extends CI_DB_result { */ function num_rows() { - // get the results, count them, - // rerun query - otherwise we - // won't have data after calling - // num_rows() - $this->result_array(); - $rowcount = count($this->result_array); - @ociexecute($this->stmt_id); - if ($this->curs_id) + if (function_exists('oci_num_rows')) + { + return @oci_num_rows($this->stmt_id); + } + else { - @ociexecute($this->curs_id); + return @ocirowcount($this->stmt_id) } - return $rowcount; } // -------------------------------------------------------------------- diff --git a/system/libraries/Email.php b/system/libraries/Email.php index 92f2e73fa..158c82af2 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -321,14 +321,7 @@ class CI_Email { */ function message($body) { - $body = rtrim(str_replace("\r", "", $body)); - - if ($this->wordwrap === TRUE AND $this->mailtype != 'html') - $this->_body = $this->word_wrap($body); - else - $this->_body = $body; - - $this->_body = stripslashes($this->_body); + $this->_body = stripslashes(rtrim(str_replace("\r", "", $body))); } // -------------------------------------------------------------------- @@ -758,59 +751,53 @@ class CI_Email { function word_wrap($str, $chars = '') { if ($chars == '') + { $chars = ($this->wrapchars == "") ? "76" : $this->wrapchars; + } - $lines = split("\n", $str); - - $output = ""; + $str = preg_replace("| +|", " ", $str); - while (list(, $thisline) = each($lines)) + $str = preg_replace("|(\[url.+\])|", "{unwrap}\\1{/unwrap}", $str); + + $output = ""; + foreach (split("\n", $str) as $current_line) { - if (strlen($thisline) > $chars) + if (strlen($current_line) > $chars) { $line = ""; - - $words = split(" ", $thisline); - - while(list(, $thisword) = each($words)) + + foreach (split(" ", $current_line) as $words) { - while((strlen($thisword)) > $chars) + while((strlen($words)) > $chars) { - if (stristr($thisword, '{unwrap}') !== FALSE OR stristr($thisword, '{/unwrap}') !== FALSE) + if (stristr($words, '{unwrap}') !== FALSE OR stristr($words, '{/unwrap}') !== FALSE) { break; } - - $cur_pos = 0; - - for($i=0; $i < $chars - 1; $i++) - { - $output .= $thisword[$i]; - $cur_pos++; - } - - $output .= "\n"; - - $thisword = substr($thisword, $cur_pos, (strlen($thisword) - $cur_pos)); + + $output .= substr($words, 0, $chars-1); + $words = substr($words, $chars-1); + + $output .= $this->newline; } - if ((strlen($line) + strlen($thisword)) > $chars) + if ((strlen($line) + strlen($words)) > $chars) { - $output .= $line."\n"; + $output .= $line.$this->newline; - $line = $thisword." "; - } - else + $line = $words." "; + } + else { - $line .= $thisword." "; + $line .= $words." "; } } - $output .= $line."\n"; - } - else + $output .= $line.$this->newline; + } + else { - $output .= $thisline."\n"; + $output .= $current_line.$this->newline; } } @@ -878,6 +865,11 @@ class CI_Email { */ function _build_message() { + if ($this->wordwrap === TRUE AND $this->mailtype != 'html') + { + $this->_body = $this->word_wrap($this->_body); + } + $this->_set_boundaries(); $this->_write_headers(); diff --git a/system/libraries/Output.php b/system/libraries/Output.php index 0c2620df7..e53627408 100644 --- a/system/libraries/Output.php +++ b/system/libraries/Output.php @@ -201,7 +201,8 @@ class CI_Output { { echo $output; log_message('debug', "Final output sent to browser"); - log_message('debug', "Total execution time: ".$elapsed); + log_message('debug', "Total execution time: ".$elapsed); + return TRUE; } // -------------------------------------------------------------------- diff --git a/user_guide/changelog.html b/user_guide/changelog.html index c8e113547..c47972247 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -64,10 +64,7 @@ Change Log

Version 1.5.0 Beta 3

-

Release Date: October 25, 2006

- -

Important:  In Beta 3, the way native libraries are extended has changed slightly thanks to -a suggestion offered by coolfactor in our forums. Please check the documentation below if you are extending classes.

+

Release Date: October 30, 2006