diff options
Diffstat (limited to 'system')
-rw-r--r-- | system/database/drivers/oci8/oci8_result.php | 16 | ||||
-rw-r--r-- | system/libraries/Email.php | 74 | ||||
-rw-r--r-- | system/libraries/Output.php | 3 |
3 files changed, 41 insertions, 52 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; } // -------------------------------------------------------------------- |