Changeset 566 for branches/1.1dev


Ignore:
Timestamp:
Oct 28, 2016 12:03:20 AM (8 years ago)
Author:
anonymous
Message:

Added ->error_reporting option. Updated Email->replace() to return replaced string.

Location:
branches/1.1dev
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/1.1dev/config/defaults.inc.php

    r348 r566  
    55
    66/*
    7  * This file contains global configration variables that apply to the underlying 
     7 * This file contains global configration variables that apply to the underlying
    88 * codebase framework. These values can be overwritten in a site-specific config
    99 * file to customize values for a specific site.
     
    2222
    2323// The level of error reporting. Don't set this to 0 to suppress messages, use display_errors to control display.
    24 error_reporting(E_ALL ^ E_NOTICE);
     24setDefault($CFG->error_reporting, E_ALL & ~E_NOTICE & ~E_STRICT);
     25error_reporting($CFG->error_reporting);
    2526
    2627// Location to store log files.
     
    8283setDefault($CFG->login_timeout, 21600);
    8384
    84 // The maximum amount of time a user is allowed to be idle before 
     85// The maximum amount of time a user is allowed to be idle before
    8586// their session expires. They will be forced to login again if they expire.
    8687// This applies to admins and users. In seconds.
     
    9192 * ACCOUNT ABUSE SETTINGS
    9293 *****************************************************************************/
    93  
     94
    9495// The period of time to compare login abuse attempts. If a threshold of
    9596// logins is reached in this amount of time the account is blocked.
     
    101102$CFG->login_abuse_warnings = 3;
    102103
    103 // The maximum number of IP addresses a user can login with over the 
     104// The maximum number of IP addresses a user can login with over the
    104105// timeout period before their account is blocked.
    105106$CFG->login_abuse_max_ips = 5;
    106107
    107 // The IP address subnet size threshold. Uses a CIDR notation 
     108// The IP address subnet size threshold. Uses a CIDR notation
    108109// network mask. Any integar between 0 and 32 is permitted. Setting this
    109110// to '24' permits any address in a class C network (255.255.255.0)
     
    140141}
    141142
    142 // The maximum byte size that the session cache will hold. 
     143// The maximum byte size that the session cache will hold.
    143144// Used in SessionCache.inc.php
    144145define('SESSION_CACHE_SIZE_BYTES', 204800); // 200 Kilobytes.
  • branches/1.1dev/lib/Email.inc.php

    r310 r566  
    88 * @author  Quinn Comendant <quinn@strangecode.com>
    99 * @version 1.0 - backported to codebase v1.1dev
    10  * 
    11  
     10 *
     11
    1212// Example.
    1313$email = new Email(array(
     
    3030}
    3131
    32  * 
     32 *
    3333 */
    3434class Email {
     
    4141        'headers' => null,
    4242        'regex' => null,
    43        
     43
    4444        // A single carriage return (\n) should terminate lines for locally injected mail.
    4545        // A carriage return + line-feed (\r\n) should be used if sending mail directly with SMTP.
    4646        'crlf' => "\n",
    47        
     47
    4848        // RFC 2822 says line length MUST be no more than 998 characters, and SHOULD be no more than 78 characters, excluding the CRLF.
    4949        // http://mailformat.dan.info/body/linelength.html
     
    187187    function replace($replacements)
    188188    {
    189    
     189
    190190        // Ensure template exists.
    191191        if (!isset($this->_template)) {
     
    209209        // Search and replace all values at once.
    210210        $this->_template_replaced = str_replace($search, $replace, $this->_template);
     211
     212        return $this->_template_replaced;
    211213    }
    212214
     
    255257        $final_body = isset($this->_template_replaced) ? $this->_template_replaced : $this->_template;
    256258        if (false !== $this->getParam('wrap')) {
    257             $final_body = wordwrap($final_body, $this->getParam('line_length'), $this->getParam('crlf'));           
     259            $final_body = wordwrap($final_body, $this->getParam('line_length'), $this->getParam('crlf'));
    258260        }
    259261
     
    287289            $envelope_sender_header = sprintf('-f %s', $envelope_sender_address);
    288290        } else {
    289             $envelope_sender_header = '';           
     291            $envelope_sender_header = '';
    290292        }
    291293
Note: See TracChangeset for help on using the changeset viewer.