From bb01c27c6c2c8e83091764cebadeef0489985b4b Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Wed, 2 Nov 2011 08:59:18 +0100 Subject: Added Mailer class --- inc/Mailer.class.php | 324 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 324 insertions(+) create mode 100644 inc/Mailer.class.php (limited to 'inc') diff --git a/inc/Mailer.class.php b/inc/Mailer.class.php new file mode 100644 index 000000000..991ec6c3e --- /dev/null +++ b/inc/Mailer.class.php @@ -0,0 +1,324 @@ + + */ + + +// end of line for mail lines - RFC822 says CRLF but postfix (and other MTAs?) +// think different +if(!defined('MAILHEADER_EOL')) define('MAILHEADER_EOL',"\n"); +#define('MAILHEADER_ASCIIONLY',1); + + +class Mailer { + + private $headers = array(); + private $attach = array(); + private $html = ''; + private $text = ''; + + private $boundary = ''; + private $partid = ''; + private $sendparam= ''; + + function __construct(){ + $this->partid = md5(uniqid(rand(),true)).'@'.$_SERVER['SERVER_NAME']; + $this->boundary = '----------'.md5(uniqid(rand(),true)); + } + + /** + * Attach a file + * + * @param $path Path to the file to attach + * @param $mime Mimetype of the attached file + * @param $name The filename to use + * @param $embed Unique key to reference this file from the HTML part + */ + public function attachFile($path,$mime,$name='',$embed=''){ + if(!$name){ + $name = basename($path); + } + + $this->attach[] = array( + 'data' => file_get_contents($path), + 'mime' => $mime, + 'name' => $name, + 'embed' => $embed + ); + } + + /** + * Attach a file + * + * @param $path The file contents to attach + * @param $mime Mimetype of the attached file + * @param $name The filename to use + * @param $embed Unique key to reference this file from the HTML part + */ + public function attachContent($data,$mime,$name='',$embed=''){ + if(!$name){ + list($junk,$ext) = split('/',$mime); + $name = count($this->attach).".$ext"; + } + + $this->attach[] = array( + 'data' => $data, + 'mime' => $mime, + 'name' => $name, + 'embed' => $embed + ); + } + + /** + * Set the HTML part of the mail + * + * Placeholders can be used to reference embedded attachments + */ + public function setHTMLBody($html){ + $this->html = $html; + } + + /** + * Set the plain text part of the mail + */ + public function setTextBody($text){ + $this->text = $text; + } + + /** + * Ses an email address header with correct encoding + * + * Unicode characters will be deaccented and encoded base64 + * for headers. Addresses may not contain Non-ASCII data! + * + * Example: + * setAddress("föö , me@somewhere.com","TBcc"); + * + * @param string $address Multiple adresses separated by commas + * @param string $header Name of the header (To,Bcc,Cc,...) + */ + function mail_encode_address($address,$header){ + // No named recipients for To: in Windows (see FS#652) + $names = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? false : true; + + $headers = ''; + $parts = explode(',',$address); + foreach ($parts as $part){ + $part = trim($part); + + // parse address + if(preg_match('#(.*?)<(.*?)>#',$part,$matches)){ + $text = trim($matches[1]); + $addr = $matches[2]; + }else{ + $addr = $part; + } + // skip empty ones + if(empty($addr)){ + continue; + } + + // FIXME: is there a way to encode the localpart of a emailaddress? + if(!utf8_isASCII($addr)){ + msg(htmlspecialchars("E-Mail address <$addr> is not ASCII"),-1); + continue; + } + + if(!mail_isvalid($addr)){ + msg(htmlspecialchars("E-Mail address <$addr> is not valid"),-1); + continue; + } + + // text was given + if(!empty($text) && $names){ + // add address quotes + $addr = "<$addr>"; + + if(defined('MAILHEADER_ASCIIONLY')){ + $text = utf8_deaccent($text); + $text = utf8_strip($text); + } + + if(!utf8_isASCII($text)){ + //FIXME + // put the quotes outside as in =?UTF-8?Q?"Elan Ruusam=C3=A4e"?= vs "=?UTF-8?Q?Elan Ruusam=C3=A4e?=" + /* + if (preg_match('/^"(.+)"$/', $text, $matches)) { + $text = '"=?UTF-8?Q?'.mail_quotedprintable_encode($matches[1], 0).'?="'; + } else { + $text = '=?UTF-8?Q?'.mail_quotedprintable_encode($text, 0).'?='; + } + */ + $text = '=?UTF-8?B?'.base64_encode($text).'?='; + } + }else{ + $text = ''; + } + + // add to header comma seperated + if($headers != ''){ + $headers .= ','; + $headers .= MAILHEADER_EOL.' '; // avoid overlong mail headers + } + $headers .= $text.' '.$addr; + } + + if(empty($headers)) return false; + + $this->headers[$header] = $headers; + return $headers; + } + + /** + * Add the To: recipients + * + * @see setAddress + * @param string $address Multiple adresses separated by commas + */ + public function to($address){ + $this->setAddress($address, 'To'); + } + + /** + * Add the Cc: recipients + * + * @see setAddress + * @param string $address Multiple adresses separated by commas + */ + public function cc($address){ + $this->setAddress($address, 'Cc'); + } + + /** + * Add the Bcc: recipients + * + * @see setAddress + * @param string $address Multiple adresses separated by commas + */ + public function bcc($address){ + $this->setAddress($address, 'Bcc'); + } + + /** + * Add the mail's Subject: header + * + * @param string $subject the mail subject + */ + public function subject($subject){ + if(!utf8_isASCII($subject)){ + $subject = '=?UTF-8?B?'.base64_encode($subject).'?='; + } + $this->headers['Subject'] = $subject; + } + + /** + * Prepare the mime multiparts for all attachments + * + * Replaces placeholders in the HTML with the correct CIDs + */ + protected function prepareAttachments(){ + $mime = ''; + $part = 1; + // embedded attachments + foreach($this->attach as $media){ + // create content id + $cid = 'part'.$part.'.'.$this->partid; + + // replace wildcards + if($media['embed']){ + $this->html = str_replace('%%'.$media['embed'].'%%','cid:'.$cid,$this->html); + } + + $mime .= '--'.$this->boundary.MAILHEADER_EOL; + $mime .= 'Content-Type: '.$media['mime'].';'.MAILHEADER_EOL; + $mime .= 'Content-Transfer-Encoding: base64'.MAILHEADER_EOL; + $mime .= "Content-ID: <$cid>".MAILHEADER_EOL; + if($media['embed']){ + $mime .= 'Content-Disposition: inline; filename="'.$media['name'].'"'.MAILHEADER_EOL; + }else{ + $mime .= 'Content-Disposition: attachment; filename="'.$media['name'].'"'.MAILHEADER_EOL; + } + $mime .= MAILHEADER_EOL; //end of headers + $mime .= chunk_split(base64_encode($media['data']),74,MAILHEADER_EOL); + + $part++; + } + return $mime; + } + + protected function createBody(){ + // check for body + if(!$this->text && !$this->html){ + return false; + } + + // add general headers + $this->headers['MIME-Version'] = '1.0'; + + if(!$this->html && !count($this->attach)){ // we can send a simple single part message + $this->headers['Content-Type'] = 'text/plain; charset=UTF-8'; + $this->headers['Content-Transfer-Encoding'] = 'base64'; + $body = chunk_split(base64_encode($this->text),74,MAILHEADER_EOL); + }else{ // multi part it is + + // prepare the attachments + $attachments = $this->prepareAttachments(); + + // do we have alternative text content? + if($this->text && $this->html){ + $this->headers['Content-Type'] = 'multipart/alternative; boundary="'.$this->boundary.'XX"'; + $body = "This is a multi-part message in MIME format.".MAILHEADER_EOL; + $body .= '--'.$this->boundary.'XX'.MAILHEADER_EOL; + $body .= MAILHEADER_EOL; + $body .= 'Content-Type: text/plain; charset=UTF-8'; + $body .= 'Content-Transfer-Encoding: base64'; + $body .= chunk_split(base64_encode($this->text),74,MAILHEADER_EOL); + $body .= '--'.$this->boundary.'XX'.MAILHEADER_EOL; + $body .= 'Content-Type: multipart/related; boundary="'.$this->boundary.'"'.MAILHEADER_EOL; + $body .= MAILHEADER_EOL; + }else{ + $this->headers['Content-Type'] = 'multipart/related; boundary="'.$this->boundary.'"'; + $body = "This is a multi-part message in MIME format.".MAILHEADER_EOL; + } + + $body .= '--'.$this->boundary."\n"; + $body .= "Content-Type: text/html; charset=UTF-8\n"; + $body .= "Content-Transfer-Encoding: base64\n"; + $body .= MAILHEADER_EOL; + $body = chunk_split(base64_encode($this->html),74,MAILHEADER_EOL); + $body .= MAILHEADER_EOL; + $body .= $attachments; + $body .= '--'.$this->boundary.'--'.MAILHEADER_EOL; + + // close open multipart/alternative boundary + if($this->text && $this->html){ + $body .= '--'.$this->boundary.'XX--'.MAILHEADER_EOL; + } + } + + return $body; + } + + /** + * Create a string from the headers array + */ + protected function prepareHeaders(){ + $headers = ''; + foreach($this->headers as $key => $val){ + $headers .= "$key: $val".MAILHEADER_EOL; + } + return $headers; + } + + /** + * return a full email with all headers + * + * This is mainly for debugging and testing + */ + public function dump(){ + $headers = $this->prepareHeaders(); + $body = $this->prepareBody(); + + return $headers.MAILHEADER_EOL.$body; + } +} -- cgit v1.2.3 From 1d045709e66a239d6a0933c0d07dfbb9fb257d48 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Wed, 2 Nov 2011 19:19:11 +0100 Subject: The Mailer class should work now It's still not real world tested but the output *looks* right. Plugin hook support is still missing. --- inc/Mailer.class.php | 173 +++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 148 insertions(+), 25 deletions(-) (limited to 'inc') diff --git a/inc/Mailer.class.php b/inc/Mailer.class.php index 991ec6c3e..420277d9e 100644 --- a/inc/Mailer.class.php +++ b/inc/Mailer.class.php @@ -1,15 +1,19 @@ */ - // end of line for mail lines - RFC822 says CRLF but postfix (and other MTAs?) // think different if(!defined('MAILHEADER_EOL')) define('MAILHEADER_EOL',"\n"); #define('MAILHEADER_ASCIIONLY',1); - class Mailer { private $headers = array(); @@ -19,10 +23,23 @@ class Mailer { private $boundary = ''; private $partid = ''; - private $sendparam= ''; + private $sendparam= null; + + private $validator = null; + + /** + * Constructor + * + * Initializes the boundary strings and part counters + */ + public function __construct(){ + if(isset($_SERVER['SERVER_NAME'])){ + $server = $_SERVER['SERVER_NAME']; + }else{ + $server = 'localhost'; + } - function __construct(){ - $this->partid = md5(uniqid(rand(),true)).'@'.$_SERVER['SERVER_NAME']; + $this->partid = md5(uniqid(rand(),true)).'@'.$server; $this->boundary = '----------'.md5(uniqid(rand(),true)); } @@ -69,24 +86,50 @@ class Mailer { ); } + /** + * Add an arbitrary header to the mail + * + * @param string $header the header name (no trailing colon!) + * @param string $value the value of the header + * @param bool $clean remove all non-ASCII chars and line feeds? + */ + public function setHeader($header,$value,$clean=true){ + $header = ucwords(strtolower($header)); // streamline casing + if($clean){ + $header = preg_replace('/[^\w \-\.\+\@]+/','',$header); + $value = preg_replace('/[^\w \-\.\+\@]+/','',$value); + } + $this->headers[$header] = $value; + } + + /** + * Set additional parameters to be passed to sendmail + * + * Whatever is set here is directly passed to PHP's mail() command as last + * parameter. Depending on the PHP setup this might break mailing alltogether + */ + public function setParameters($param){ + $this->sendparam = $param; + } + /** * Set the HTML part of the mail * * Placeholders can be used to reference embedded attachments */ - public function setHTMLBody($html){ + public function setHTML($html){ $this->html = $html; } /** * Set the plain text part of the mail */ - public function setTextBody($text){ + public function setText($text){ $this->text = $text; } /** - * Ses an email address header with correct encoding + * Sets an email address header with correct encoding * * Unicode characters will be deaccented and encoded base64 * for headers. Addresses may not contain Non-ASCII data! @@ -97,10 +140,13 @@ class Mailer { * @param string $address Multiple adresses separated by commas * @param string $header Name of the header (To,Bcc,Cc,...) */ - function mail_encode_address($address,$header){ + function setAddress($address,$header){ // No named recipients for To: in Windows (see FS#652) $names = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? false : true; + $header = ucwords(strtolower($header)); // streamline casing + $address = preg_replace('/[\r\n\0]+/',' ',$address); // remove attack vectors + $headers = ''; $parts = explode(',',$address); foreach ($parts as $part){ @@ -124,7 +170,11 @@ class Mailer { continue; } - if(!mail_isvalid($addr)){ + if(is_null($this->validator)){ + $this->validator = new EmailAddressValidator(); + $this->validator->allowLocalAddresses = true; + } + if(!$this->validator->check_email_address($addr)){ msg(htmlspecialchars("E-Mail address <$addr> is not valid"),-1); continue; } @@ -140,7 +190,7 @@ class Mailer { } if(!utf8_isASCII($text)){ - //FIXME + //FIXME check if this is needed for base64 too // put the quotes outside as in =?UTF-8?Q?"Elan Ruusam=C3=A4e"?= vs "=?UTF-8?Q?Elan Ruusam=C3=A4e?=" /* if (preg_match('/^"(.+)"$/', $text, $matches)) { @@ -199,6 +249,19 @@ class Mailer { $this->setAddress($address, 'Bcc'); } + /** + * Add the From: address + * + * This is set to $conf['mailfrom'] when not specified so you shouldn't need + * to call this function + * + * @see setAddress + * @param string $address from address + */ + public function from($address){ + $this->setAddress($address, 'From'); + } + /** * Add the mail's Subject: header * @@ -246,20 +309,33 @@ class Mailer { return $mime; } - protected function createBody(){ + /** + * Build the body and handles multi part mails + * + * Needs to be called before prepareHeaders! + * + * @return string the prepared mail body, false on errors + */ + protected function prepareBody(){ + global $conf; + // check for body if(!$this->text && !$this->html){ return false; } // add general headers + if(!isset($this->headers['From'])) $this->from($conf['mailfrom']); $this->headers['MIME-Version'] = '1.0'; + $body = ''; + if(!$this->html && !count($this->attach)){ // we can send a simple single part message $this->headers['Content-Type'] = 'text/plain; charset=UTF-8'; $this->headers['Content-Transfer-Encoding'] = 'base64'; - $body = chunk_split(base64_encode($this->text),74,MAILHEADER_EOL); + $body .= chunk_split(base64_encode($this->text),74,MAILHEADER_EOL); }else{ // multi part it is + $body .= "This is a multi-part message in MIME format.".MAILHEADER_EOL; // prepare the attachments $attachments = $this->prepareAttachments(); @@ -267,25 +343,21 @@ class Mailer { // do we have alternative text content? if($this->text && $this->html){ $this->headers['Content-Type'] = 'multipart/alternative; boundary="'.$this->boundary.'XX"'; - $body = "This is a multi-part message in MIME format.".MAILHEADER_EOL; $body .= '--'.$this->boundary.'XX'.MAILHEADER_EOL; + $body .= 'Content-Type: text/plain; charset=UTF-8'.MAILHEADER_EOL; + $body .= 'Content-Transfer-Encoding: base64'.MAILHEADER_EOL; $body .= MAILHEADER_EOL; - $body .= 'Content-Type: text/plain; charset=UTF-8'; - $body .= 'Content-Transfer-Encoding: base64'; $body .= chunk_split(base64_encode($this->text),74,MAILHEADER_EOL); $body .= '--'.$this->boundary.'XX'.MAILHEADER_EOL; $body .= 'Content-Type: multipart/related; boundary="'.$this->boundary.'"'.MAILHEADER_EOL; $body .= MAILHEADER_EOL; - }else{ - $this->headers['Content-Type'] = 'multipart/related; boundary="'.$this->boundary.'"'; - $body = "This is a multi-part message in MIME format.".MAILHEADER_EOL; } - $body .= '--'.$this->boundary."\n"; - $body .= "Content-Type: text/html; charset=UTF-8\n"; - $body .= "Content-Transfer-Encoding: base64\n"; + $body .= '--'.$this->boundary.MAILHEADER_EOL; + $body .= 'Content-Type: text/html; charset=UTF-8'.MAILHEADER_EOL; + $body .= 'Content-Transfer-Encoding: base64'.MAILHEADER_EOL; $body .= MAILHEADER_EOL; - $body = chunk_split(base64_encode($this->html),74,MAILHEADER_EOL); + $body .= chunk_split(base64_encode($this->html),74,MAILHEADER_EOL); $body .= MAILHEADER_EOL; $body .= $attachments; $body .= '--'.$this->boundary.'--'.MAILHEADER_EOL; @@ -301,6 +373,8 @@ class Mailer { /** * Create a string from the headers array + * + * @returns string the headers */ protected function prepareHeaders(){ $headers = ''; @@ -313,12 +387,61 @@ class Mailer { /** * return a full email with all headers * - * This is mainly for debugging and testing + * This is mainly intended for debugging and testing but could also be + * used for MHT exports + * + * @return string the mail, false on errors */ public function dump(){ - $headers = $this->prepareHeaders(); $body = $this->prepareBody(); + if($body === 'false') return false; + $headers = $this->prepareHeaders(); return $headers.MAILHEADER_EOL.$body; } + + /** + * Send the mail + * + * Call this after all data was set + * + * @fixme we need to support the old plugin hook here! + * @return bool true if the mail was successfully passed to the MTA + */ + public function send(){ + // any recipients? + if(trim($this->headers['To']) === '' && + trim($this->headers['Cc']) === '' && + trim($this->headers['Bcc']) === '') return false; + + // The To: header is special + if(isset($this->headers['To'])){ + $to = $this->headers['To']; + unset($this->headers['To']); + }else{ + $to = ''; + } + + // so is the subject + if(isset($this->headers['Subject'])){ + $subject = $this->headers['Subject']; + unset($this->headers['Subject']); + }else{ + $subject = ''; + } + + // make the body + $body = $this->prepareBody(); + if($body === 'false') return false; + + // cook the headers + $headers = $this->prepareHeaders(); + + // send the thing + if(is_null($this->sendparam)){ + return @mail($to,$subject,$body,$headers); + }else{ + return @mail($to,$subject,$body,$headers,$this->sendparam); + } + } } -- cgit v1.2.3 From a36fc3485fd92593133d56e9bb98d739d70ed94f Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sat, 12 Nov 2011 11:01:22 +0100 Subject: clean headers in a separate step this should make it easier to reintroduce a plugin hook compatible with the old one --- inc/Mailer.class.php | 179 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 115 insertions(+), 64 deletions(-) (limited to 'inc') diff --git a/inc/Mailer.class.php b/inc/Mailer.class.php index 420277d9e..8f2992201 100644 --- a/inc/Mailer.class.php +++ b/inc/Mailer.class.php @@ -89,6 +89,8 @@ class Mailer { /** * Add an arbitrary header to the mail * + * If an empy value is passed, the header is removed + * * @param string $header the header name (no trailing colon!) * @param string $value the value of the header * @param bool $clean remove all non-ASCII chars and line feeds? @@ -99,7 +101,14 @@ class Mailer { $header = preg_replace('/[^\w \-\.\+\@]+/','',$header); $value = preg_replace('/[^\w \-\.\+\@]+/','',$value); } - $this->headers[$header] = $value; + + // empty value deletes + $value = trim($value); + if($value === ''){ + if(isset($this->headers[$header])) unset($this->headers[$header]); + }else{ + $this->headers[$header] = $value; + } } /** @@ -128,6 +137,58 @@ class Mailer { $this->text = $text; } + /** + * Add the To: recipients + * + * @see setAddress + * @param string $address Multiple adresses separated by commas + */ + public function to($address){ + $this->setHeader('To', $address, false); + } + + /** + * Add the Cc: recipients + * + * @see setAddress + * @param string $address Multiple adresses separated by commas + */ + public function cc($address){ + $this->setHeader('Cc', $address, false); + } + + /** + * Add the Bcc: recipients + * + * @see setAddress + * @param string $address Multiple adresses separated by commas + */ + public function bcc($address){ + $this->setHeader('Bcc', $address, false); + } + + /** + * Add the From: address + * + * This is set to $conf['mailfrom'] when not specified so you shouldn't need + * to call this function + * + * @see setAddress + * @param string $address from address + */ + public function from($address){ + $this->setHeader('From', $address, false); + } + + /** + * Add the mail's Subject: header + * + * @param string $subject the mail subject + */ + public function subject($subject){ + $this->headers['Subject'] = $subject; + } + /** * Sets an email address header with correct encoding * @@ -138,13 +199,12 @@ class Mailer { * setAddress("föö , me@somewhere.com","TBcc"); * * @param string $address Multiple adresses separated by commas - * @param string $header Name of the header (To,Bcc,Cc,...) + * @param string returns the prepared header (can contain multiple lines) */ - function setAddress($address,$header){ + public function cleanAddress($address){ // No named recipients for To: in Windows (see FS#652) $names = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? false : true; - $header = ucwords(strtolower($header)); // streamline casing $address = preg_replace('/[\r\n\0]+/',' ',$address); // remove attack vectors $headers = ''; @@ -207,72 +267,16 @@ class Mailer { // add to header comma seperated if($headers != ''){ - $headers .= ','; - $headers .= MAILHEADER_EOL.' '; // avoid overlong mail headers + $headers .= ', '; } $headers .= $text.' '.$addr; } if(empty($headers)) return false; - $this->headers[$header] = $headers; return $headers; } - /** - * Add the To: recipients - * - * @see setAddress - * @param string $address Multiple adresses separated by commas - */ - public function to($address){ - $this->setAddress($address, 'To'); - } - - /** - * Add the Cc: recipients - * - * @see setAddress - * @param string $address Multiple adresses separated by commas - */ - public function cc($address){ - $this->setAddress($address, 'Cc'); - } - - /** - * Add the Bcc: recipients - * - * @see setAddress - * @param string $address Multiple adresses separated by commas - */ - public function bcc($address){ - $this->setAddress($address, 'Bcc'); - } - - /** - * Add the From: address - * - * This is set to $conf['mailfrom'] when not specified so you shouldn't need - * to call this function - * - * @see setAddress - * @param string $address from address - */ - public function from($address){ - $this->setAddress($address, 'From'); - } - - /** - * Add the mail's Subject: header - * - * @param string $subject the mail subject - */ - public function subject($subject){ - if(!utf8_isASCII($subject)){ - $subject = '=?UTF-8?B?'.base64_encode($subject).'?='; - } - $this->headers['Subject'] = $subject; - } /** * Prepare the mime multiparts for all attachments @@ -325,7 +329,6 @@ class Mailer { } // add general headers - if(!isset($this->headers['From'])) $this->from($conf['mailfrom']); $this->headers['MIME-Version'] = '1.0'; $body = ''; @@ -342,14 +345,16 @@ class Mailer { // do we have alternative text content? if($this->text && $this->html){ - $this->headers['Content-Type'] = 'multipart/alternative; boundary="'.$this->boundary.'XX"'; + $this->headers['Content-Type'] = 'multipart/alternative;'.MAILHEADER_EOL. + ' boundary="'.$this->boundary.'XX"'; $body .= '--'.$this->boundary.'XX'.MAILHEADER_EOL; $body .= 'Content-Type: text/plain; charset=UTF-8'.MAILHEADER_EOL; $body .= 'Content-Transfer-Encoding: base64'.MAILHEADER_EOL; $body .= MAILHEADER_EOL; $body .= chunk_split(base64_encode($this->text),74,MAILHEADER_EOL); $body .= '--'.$this->boundary.'XX'.MAILHEADER_EOL; - $body .= 'Content-Type: multipart/related; boundary="'.$this->boundary.'"'.MAILHEADER_EOL; + $body .= 'Content-Type: multipart/related;'.MAILHEADER_EOL. + ' boundary="'.$this->boundary.'"'.MAILHEADER_EOL; $body .= MAILHEADER_EOL; } @@ -371,6 +376,47 @@ class Mailer { return $body; } + /** + * Cleanup and encode the headers array + */ + protected function cleanHeaders(){ + global $conf; + + // clean up addresses + if(empty($this->headers['From'])) $this->from($conf['mailfrom']); + $addrs = array('To','From','Cc','Bcc'); + foreach($addrs as $addr){ + if(isset($this->headers[$addr])){ + $this->headers[$addr] = $this->cleanAddress($this->headers[$addr]); + } + } + + if(isset($subject)){ + // add prefix to subject + if($conf['mailprefix']){ + $prefix = '['.$conf['mailprefix'].']'; + $len = strlen($prefix); + if(substr($this->headers['subject'],0,$len) != $prefix){ + $this->headers['subject'] = $prefix.' '.$this->headers['subject']; + } + } + + // encode subject + if(defined('MAILHEADER_ASCIIONLY')){ + $this->headers['subject'] = utf8_deaccent($this->headers['subject']); + $this->headers['subject'] = utf8_strip($this->headers['subject']); + } + if(!utf8_isASCII($this->headers['Subject'])){ + $subject = '=?UTF-8?B?'.base64_encode($this->headers['Subject']).'?='; + } + } + + // wrap headers + foreach($this->headers as $key => $val){ + $this->headers[$key] = wordwrap($val,78,MAILHEADER_EOL.' '); + } + } + /** * Create a string from the headers array * @@ -393,6 +439,7 @@ class Mailer { * @return string the mail, false on errors */ public function dump(){ + $this->cleanHeaders(); $body = $this->prepareBody(); if($body === 'false') return false; $headers = $this->prepareHeaders(); @@ -409,6 +456,10 @@ class Mailer { * @return bool true if the mail was successfully passed to the MTA */ public function send(){ + // FIXME hook here + + $this->cleanHeaders(); + // any recipients? if(trim($this->headers['To']) === '' && trim($this->headers['Cc']) === '' && -- cgit v1.2.3 From 28d2ad801d5eafcfdfc9a122966458b2689a7ec6 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sat, 12 Nov 2011 11:35:17 +0100 Subject: added old plugin hook back into Mailer class it now passes the whole Mail object and also signals if the mail sending was successful to the AFTER event. A bunch of references should make it compatible with old plugins. --- inc/Mailer.class.php | 95 ++++++++++++++++++++++++++++++++++------------------ 1 file changed, 62 insertions(+), 33 deletions(-) (limited to 'inc') diff --git a/inc/Mailer.class.php b/inc/Mailer.class.php index 8f2992201..3b7762e77 100644 --- a/inc/Mailer.class.php +++ b/inc/Mailer.class.php @@ -452,47 +452,76 @@ class Mailer { * * Call this after all data was set * - * @fixme we need to support the old plugin hook here! + * @triggers MAIL_MESSAGE_SEND * @return bool true if the mail was successfully passed to the MTA */ public function send(){ - // FIXME hook here - - $this->cleanHeaders(); - - // any recipients? - if(trim($this->headers['To']) === '' && - trim($this->headers['Cc']) === '' && - trim($this->headers['Bcc']) === '') return false; + $success = false; + + // prepare hook data + $data = array( + // pass the whole mail class to plugin + 'mail' => $this, + // pass references for backward compatibility + 'to' => &$this->headers['To'], + 'cc' => &$this->headers['Cc'], + 'bcc' => &$this->headers['Bcc'], + 'from' => &$this->headers['From'], + 'subject' => &$this->headers['Subject'], + 'body' => &$this->text, + 'params' => &$this->sendparams, + 'headers' => '', // plugins shouldn't use this + // signal if we mailed successfully to AFTER event + 'success' => &$success, + ); - // The To: header is special - if(isset($this->headers['To'])){ - $to = $this->headers['To']; - unset($this->headers['To']); - }else{ - $to = ''; - } + // do our thing if BEFORE hook approves + $evt = new Doku_Event('MAIL_MESSAGE_SEND', $data); + if ($evt->advise_before(true)) { + // clean up before using the headers + $this->cleanHeaders(); + + // any recipients? + if(trim($this->headers['To']) === '' && + trim($this->headers['Cc']) === '' && + trim($this->headers['Bcc']) === '') return false; + + // The To: header is special + if(isset($this->headers['To'])){ + $to = $this->headers['To']; + unset($this->headers['To']); + }else{ + $to = ''; + } - // so is the subject - if(isset($this->headers['Subject'])){ - $subject = $this->headers['Subject']; - unset($this->headers['Subject']); - }else{ - $subject = ''; - } + // so is the subject + if(isset($this->headers['Subject'])){ + $subject = $this->headers['Subject']; + unset($this->headers['Subject']); + }else{ + $subject = ''; + } - // make the body - $body = $this->prepareBody(); - if($body === 'false') return false; + // make the body + $body = $this->prepareBody(); + if($body === 'false') return false; - // cook the headers - $headers = $this->prepareHeaders(); + // cook the headers + $headers = $this->prepareHeaders(); + // add any headers set by legacy plugins + if(trim($data['headers'])){ + $headers .= MAILHEADER_EOL.trim($data['headers']); + } - // send the thing - if(is_null($this->sendparam)){ - return @mail($to,$subject,$body,$headers); - }else{ - return @mail($to,$subject,$body,$headers,$this->sendparam); + // send the thing + if(is_null($this->sendparam)){ + $success = @mail($to,$subject,$body,$headers); + }else{ + $success = @mail($to,$subject,$body,$headers,$this->sendparam); + } } + // any AFTER actions? + $evt->advise_after(); + return $success; } } -- cgit v1.2.3 From 54f3075553a782ff5e32a5326f0e225f4437be29 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sat, 12 Nov 2011 11:54:51 +0100 Subject: mail prefix defaults to title when empty --- inc/Mailer.class.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'inc') diff --git a/inc/Mailer.class.php b/inc/Mailer.class.php index 3b7762e77..7b09cf75e 100644 --- a/inc/Mailer.class.php +++ b/inc/Mailer.class.php @@ -393,12 +393,14 @@ class Mailer { if(isset($subject)){ // add prefix to subject - if($conf['mailprefix']){ + if(empty($conf['mailprefix'])){ + $prefix = '['.$conf['title'].']'; + }else{ $prefix = '['.$conf['mailprefix'].']'; - $len = strlen($prefix); - if(substr($this->headers['subject'],0,$len) != $prefix){ - $this->headers['subject'] = $prefix.' '.$this->headers['subject']; - } + } + $len = strlen($prefix); + if(substr($this->headers['subject'],0,$len) != $prefix){ + $this->headers['subject'] = $prefix.' '.$this->headers['subject']; } // encode subject -- cgit v1.2.3 From 8a215f0965e27ba6b9e62b955890f1acc9445883 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sat, 12 Nov 2011 12:20:46 +0100 Subject: shorten title when used as prefix --- inc/Mailer.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'inc') diff --git a/inc/Mailer.class.php b/inc/Mailer.class.php index 7b09cf75e..ffacc661d 100644 --- a/inc/Mailer.class.php +++ b/inc/Mailer.class.php @@ -394,7 +394,11 @@ class Mailer { if(isset($subject)){ // add prefix to subject if(empty($conf['mailprefix'])){ - $prefix = '['.$conf['title'].']'; + if(utf8_strlen($conf['title']) < 20) { + $prefix = '['.$conf['title'].']'; + }else{ + $prefix = '['.utf8_substr($conf['title'], 0, 20).'...]'; + } }else{ $prefix = '['.$conf['mailprefix'].']'; } -- cgit v1.2.3 From abbf08905d37ee82c6dda4c2afdbb54383c91517 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sat, 12 Nov 2011 13:02:00 +0100 Subject: Added setBody() to Mailer class This method makes it easy to send a HTML mail based on the default text mails. This is probably enough for simpler mails where no sophisticated HTML is needed except a bit of formatting and linked URLs. --- inc/Mailer.class.php | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) (limited to 'inc') diff --git a/inc/Mailer.class.php b/inc/Mailer.class.php index ffacc661d..b86a9d8f2 100644 --- a/inc/Mailer.class.php +++ b/inc/Mailer.class.php @@ -121,10 +121,80 @@ class Mailer { $this->sendparam = $param; } + /** + * Set the text and HTML body and apply replacements + * + * This function applies a whole bunch of default replacements in addition + * to the ones specidifed as parameters + * + * If you pass the HTML part or HTML replacements yourself you have to make + * sure you encode all HTML special chars correctly + * + * @fixme the HTML head and body still needs to be set + * @param string $text plain text body + * @param array $textrep replacements to apply on the text part + * @param array $htmlrep replacements to apply on the HTML part, leave null to use $textrep + * @param array $html the HTML body, leave null to create it from $text + */ + public function setBody($text, $textrep=null, $htmlrep=null, $html=null){ + global $INFO; + global $conf; + + // create HTML from text if not given + if(is_null($html)){ + $html = hsc($text); + $html = nl2br($text); + } + if(!is_null($textrep) && is_null($htmlrep)){ + $htmlrep = array_map('hsc',$textrep); + } + + // prepare default replacements + $ip = clientIP(); + $trep = array( + 'DATE' => dformat(), + 'BROWSER' => $_SERVER['HTTP_USER_AGENT'], + 'IPADDRESS' => $ip, + 'HOSTNAME' => gethostsbyaddrs($ip), + 'TITLE' => $conf['title'], + 'DOKUWIKIURL' => DOKU_URL, + 'USER' => $_SERVER['REMOTE_USER'], + 'NAME' => $INFO['userinfo']['name'], + 'MAIL' => $INFO['userinfo']['mail'], + ); + $trep = array_merge($trep,(array) $textrep); + $hrep = array( + 'DATE' => ''.hsc(dformat()).'', + 'BROWSER' => hsc($_SERVER['HTTP_USER_AGENT']), + 'IPADDRESS' => ''.hsc($ip).'', + 'HOSTNAME' => ''.hsc(gethostsbyaddrs($ip)).'', + 'TITLE' => hsc($conf['title']), + 'DOKUWIKIURL' => ''.DOKU_URL.'', + 'USER' => hsc($_SERVER['REMOTE_USER']), + 'NAME' => hsc($INFO['userinfo']['name']), + 'MAIL' => ''. + hsc($INFO['userinfo']['mail']).'', + ); + $hrep = array_merge($hrep,(array) $htmlrep); + + // Apply replacements + foreach ($trep as $key => $substitution) { + $text = str_replace('@'.strtoupper($key).'@',$substitution, $text); + } + foreach ($hrep as $key => $substitution) { + $html = str_replace('@'.strtoupper($key).'@',$substitution, $html); + } + + $this->setHTML($html); + $this->setText($text); + } + /** * Set the HTML part of the mail * * Placeholders can be used to reference embedded attachments + * + * You probably want to use setBody() instead */ public function setHTML($html){ $this->html = $html; @@ -132,6 +202,8 @@ class Mailer { /** * Set the plain text part of the mail + * + * You probably want to use setBody() instead */ public function setText($text){ $this->text = $text; -- cgit v1.2.3 From 76efd6d0637bb67b7dadf65f29a945fe2ce5fc25 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sat, 12 Nov 2011 17:00:25 +0100 Subject: Copy all text replacements to HTML replacements in Mailer With this change it's easy to just set the replacements for HTML that need special attention. --- inc/Mailer.class.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'inc') diff --git a/inc/Mailer.class.php b/inc/Mailer.class.php index b86a9d8f2..09e457243 100644 --- a/inc/Mailer.class.php +++ b/inc/Mailer.class.php @@ -139,14 +139,22 @@ class Mailer { public function setBody($text, $textrep=null, $htmlrep=null, $html=null){ global $INFO; global $conf; + $htmlrep = (array) $htmlrep; + $textrep = (array) $textrep; // create HTML from text if not given if(is_null($html)){ $html = hsc($text); $html = nl2br($text); } - if(!is_null($textrep) && is_null($htmlrep)){ - $htmlrep = array_map('hsc',$textrep); + // copy over all replacements missing for HTML (autolink URLs) + foreach($textrep as $key => $value){ + if(isset($htmlrep[$key])) continue; + if(preg_match('/^https?:\/\//i',$value)){ + $htmlrep[$key] = ''.hsc($value).''; + }else{ + $htmlrep[$key] = hsc($value); + } } // prepare default replacements -- cgit v1.2.3 From 6df843ee8dd8133de3e4e8d5cb742d2afa5f6761 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sat, 12 Nov 2011 17:02:02 +0100 Subject: Make use of new Mailer class in notify() It now uses inline diff format for diff HTML mails --- inc/common.php | 74 +++++++++++++++++++++++++++------------------------------- 1 file changed, 34 insertions(+), 40 deletions(-) (limited to 'inc') diff --git a/inc/common.php b/inc/common.php index 0c769c50d..b624c334c 100644 --- a/inc/common.php +++ b/inc/common.php @@ -1087,7 +1087,7 @@ function notify($id,$who,$rev='',$summary='',$minor=false,$replace=array()){ global $conf; global $INFO; - // decide if there is something to do + // decide if there is something to do, eg. whom to mail if($who == 'admin'){ if(empty($conf['notify'])) return; //notify enabled? $text = rawLocale('mailtext'); @@ -1112,49 +1112,43 @@ function notify($id,$who,$rev='',$summary='',$minor=false,$replace=array()){ return; //just to be safe } - $ip = clientIP(); - $text = str_replace('@DATE@',dformat(),$text); - $text = str_replace('@BROWSER@',$_SERVER['HTTP_USER_AGENT'],$text); - $text = str_replace('@IPADDRESS@',$ip,$text); - $text = str_replace('@HOSTNAME@',gethostsbyaddrs($ip),$text); - $text = str_replace('@NEWPAGE@',wl($id,'',true,'&'),$text); - $text = str_replace('@PAGE@',$id,$text); - $text = str_replace('@TITLE@',$conf['title'],$text); - $text = str_replace('@DOKUWIKIURL@',DOKU_URL,$text); - $text = str_replace('@SUMMARY@',$summary,$text); - $text = str_replace('@USER@',$_SERVER['REMOTE_USER'],$text); - $text = str_replace('@NAME@',$INFO['userinfo']['name'],$text); - $text = str_replace('@MAIL@',$INFO['userinfo']['mail'],$text); - - foreach ($replace as $key => $substitution) { - $text = str_replace('@'.strtoupper($key).'@',$substitution, $text); - } + // prepare replacements (keys not set in hrep will be taken from trep) + $trep = array( + 'NEWPAGE' => wl($id,'',true,'&'), + 'PAGE' => $id, + 'SUMMARY' => $summary + ); + $trep = array_merge($trep,$replace); + $hrep = array(); + // prepare content if($who == 'register'){ - $subject = $lang['mail_new_user'].' '.$summary; + $subject = $lang['mail_new_user'].' '.$summary; }elseif($rev){ - $subject = $lang['mail_changed'].' '.$id; - $text = str_replace('@OLDPAGE@',wl($id,"rev=$rev",true,'&'),$text); - $df = new Diff(explode("\n",rawWiki($id,$rev)), - explode("\n",rawWiki($id))); - $dformat = new UnifiedDiffFormatter(); - $diff = $dformat->format($df); + $subject = $lang['mail_changed'].' '.$id; + $trep['OLDPAGE'] = wl($id,"rev=$rev",true,'&'); + $df = new Diff(explode("\n",rawWiki($id,$rev)), + explode("\n",rawWiki($id))); + $dformat = new UnifiedDiffFormatter(); + $tdiff = $dformat->format($df); + $dformat = new InlineDiffFormatter(); + $hdiff = $dformat->format($df); }else{ - $subject=$lang['mail_newpage'].' '.$id; - $text = str_replace('@OLDPAGE@','none',$text); - $diff = rawWiki($id); - } - $text = str_replace('@DIFF@',$diff,$text); - if(empty($conf['mailprefix'])) { - if(utf8_strlen($conf['title']) < 20) { - $subject = '['.$conf['title'].'] '.$subject; - }else{ - $subject = '['.utf8_substr($conf['title'], 0, 20).'...] '.$subject; - } - }else{ - $subject = '['.$conf['mailprefix'].'] '.$subject; - } - mail_send($to,$subject,$text,$conf['mailfrom'],'',$bcc); + $subject = $lang['mail_newpage'].' '.$id; + $trep['OLDPAGE'] = '---'; + $tdiff = rawWiki($id); + $hdiff = nl2br(hsc($tdiff)); + } + $trep['DIFF'] = $tdiff; + $hrep['DIFF'] = $hdiff; + + // send mail + $mail = new Mailer(); + $mail->to($to); + $mail->bcc($bcc); + $mail->subject($subject); + $mail->setBody($text,$trep); + return $mail->send(); } /** -- cgit v1.2.3 From d7169d19cde6fc49e27e7444e424549212339ff9 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sat, 12 Nov 2011 17:50:47 +0100 Subject: Replaced mail_send calls with new Mailer class --- inc/auth.php | 42 ++++++++++++++++++++++-------------------- inc/media.php | 34 ++++++++++++++-------------------- inc/subscription.php | 18 ++++++++---------- 3 files changed, 44 insertions(+), 50 deletions(-) (limited to 'inc') diff --git a/inc/auth.php b/inc/auth.php index eff984b36..49346a84f 100644 --- a/inc/auth.php +++ b/inc/auth.php @@ -667,16 +667,17 @@ function auth_sendPassword($user,$password){ if(!$userinfo['mail']) return false; $text = rawLocale('password'); - $text = str_replace('@DOKUWIKIURL@',DOKU_URL,$text); - $text = str_replace('@FULLNAME@',$userinfo['name'],$text); - $text = str_replace('@LOGIN@',$user,$text); - $text = str_replace('@PASSWORD@',$password,$text); - $text = str_replace('@TITLE@',$conf['title'],$text); - - return mail_send($userinfo['name'].' <'.$userinfo['mail'].'>', - $lang['regpwmail'], - $text, - $conf['mailfrom']); + $trep = array( + 'FULLNAME' => $userinfo['name'], + 'LOGIN' => $user, + 'PASSWORD' => $password + ); + + $mail = new Mailer(); + $mail->to($userinfo['name'].' <'.$userinfo['mail'].'>'); + $mail->subject($lang['regpwmail']); + $mail->setBody($text,$trep); + return $mail->send(); } /** @@ -906,16 +907,17 @@ function act_resendpwd(){ io_saveFile($tfile,$user); $text = rawLocale('pwconfirm'); - $text = str_replace('@DOKUWIKIURL@',DOKU_URL,$text); - $text = str_replace('@FULLNAME@',$userinfo['name'],$text); - $text = str_replace('@LOGIN@',$user,$text); - $text = str_replace('@TITLE@',$conf['title'],$text); - $text = str_replace('@CONFIRM@',$url,$text); - - if(mail_send($userinfo['name'].' <'.$userinfo['mail'].'>', - $lang['regpwmail'], - $text, - $conf['mailfrom'])){ + $trep = array( + 'FULLNAME' => $userinfo['name'], + 'LOGIN' => $user, + 'CONFIRM' => $url + ); + + $mail = new Mailer(); + $mail->to($userinfo['name'].' <'.$userinfo['mail'].'>'); + $mail->subject($lang['regpwmail']); + $mail->setBody($text,$trep); + if($mail->send()){ msg($lang['resendpwdconfirm'],1); }else{ msg($lang['regmailfail'],-1); diff --git a/inc/media.php b/inc/media.php index 9d3e90a54..4e014877b 100644 --- a/inc/media.php +++ b/inc/media.php @@ -514,6 +514,7 @@ function media_contentcheck($file,$mime){ * Send a notify mail on uploads * * @author Andreas Gohr + * @fixme this should embed thumbnails of images in HTML version */ function media_notify($id,$file,$mime,$old_rev=false){ global $lang; @@ -521,31 +522,24 @@ function media_notify($id,$file,$mime,$old_rev=false){ global $INFO; if(empty($conf['notify'])) return; //notify enabled? - $ip = clientIP(); - $text = rawLocale('uploadmail'); - $text = str_replace('@DATE@',dformat(),$text); - $text = str_replace('@BROWSER@',$_SERVER['HTTP_USER_AGENT'],$text); - $text = str_replace('@IPADDRESS@',$ip,$text); - $text = str_replace('@HOSTNAME@',gethostsbyaddrs($ip),$text); - $text = str_replace('@DOKUWIKIURL@',DOKU_URL,$text); - $text = str_replace('@USER@',$_SERVER['REMOTE_USER'],$text); - $text = str_replace('@MIME@',$mime,$text); - $text = str_replace('@MEDIA@',ml($id,'',true,'&',true),$text); - $text = str_replace('@SIZE@',filesize_h(filesize($file)),$text); - if ($old_rev && $conf['mediarevisions']) { - $text = str_replace('@OLD@', ml($id, "rev=$old_rev", true, '&', true), $text); - } else { - $text = str_replace('@OLD@', '', $text); - } + $trep = array( + 'MIME' => $mime, + 'MEDIA' => ml($id,'',true,'&',true), + 'SIZE' => filesize_h(filesize($file)), + ); - if(empty($conf['mailprefix'])) { - $subject = '['.$conf['title'].'] '.$lang['mail_upload'].' '.$id; + if ($old_rev && $conf['mediarevisions']) { + $trep['OLD'] = ml($id, "rev=$old_rev", true, '&', true); } else { - $subject = '['.$conf['mailprefix'].'] '.$lang['mail_upload'].' '.$id; + $trep['OLD'] = '---'; } - mail_send($conf['notify'],$subject,$text,$conf['mailfrom']); + $mail = new Mailer(); + $mail->to($conf['notify']); + $mail->subject($lang['mail_upload'].' '.$id); + $mail->setBody($text,$trep); + return $mail->send(); } /** diff --git a/inc/subscription.php b/inc/subscription.php index c94f17ad0..e9f17bc28 100644 --- a/inc/subscription.php +++ b/inc/subscription.php @@ -377,18 +377,16 @@ function subscription_send_list($subscriber_mail, $ids, $ns_id) { */ function subscription_send($subscriber_mail, $replaces, $subject, $id, $template) { global $conf; + global $lang; $text = rawLocale($template); - $replaces = array_merge($replaces, array('TITLE' => $conf['title'], - 'DOKUWIKIURL' => DOKU_URL, - 'PAGE' => $id)); - - foreach ($replaces as $key => $substitution) { - $text = str_replace('@'.strtoupper($key).'@', $substitution, $text); - } + $trep = array_merge($replaces, array('PAGE' => $id)); - global $lang; $subject = $lang['mail_' . $subject] . ' ' . $id; - mail_send('', '['.$conf['title'].'] '. $subject, $text, - $conf['mailfrom'], '', $subscriber_mail); + $mail = new Mailer(); + $mail->bcc($subscriber_mail); + $mail->subject($subject); + $mail->setBody($text,$trep); + + return $mail->send(); } -- cgit v1.2.3 From c9a53c46de6ad79de64bd49ca6e4e8296982aa86 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sat, 12 Nov 2011 17:52:19 +0100 Subject: added Mailer class to autoloader --- inc/load.php | 1 + 1 file changed, 1 insertion(+) (limited to 'inc') diff --git a/inc/load.php b/inc/load.php index d30397f6e..b5cfd4273 100644 --- a/inc/load.php +++ b/inc/load.php @@ -76,6 +76,7 @@ function load_autoload($name){ 'SafeFN' => DOKU_INC.'inc/SafeFN.class.php', 'Sitemapper' => DOKU_INC.'inc/Sitemapper.php', 'PassHash' => DOKU_INC.'inc/PassHash.class.php', + 'Mailer' => DOKU_INC.'inc/Mailer.class.php', 'DokuWiki_Action_Plugin' => DOKU_PLUGIN.'action.php', 'DokuWiki_Admin_Plugin' => DOKU_PLUGIN.'admin.php', -- cgit v1.2.3 From 2adaf2b8a608f4a1ac3fe0dba94ff28d7a0d48e5 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 13 Nov 2011 12:18:09 +0100 Subject: allow non-txt extensions when accessing locales --- inc/common.php | 4 ++-- inc/pageutils.php | 16 +++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) (limited to 'inc') diff --git a/inc/common.php b/inc/common.php index b624c334c..1d8061ab0 100644 --- a/inc/common.php +++ b/inc/common.php @@ -789,8 +789,8 @@ function formText($text){ * * @author Andreas Gohr */ -function rawLocale($id){ - return io_readFile(localeFN($id)); +function rawLocale($id,$ext='txt'){ + return io_readFile(localeFN($id,$ext)); } /** diff --git a/inc/pageutils.php b/inc/pageutils.php index 31b5f9ff9..c355d4894 100644 --- a/inc/pageutils.php +++ b/inc/pageutils.php @@ -347,27 +347,29 @@ function mediaFN($id, $rev=''){ if(empty($rev)){ $fn = $conf['mediadir'].'/'.utf8_encodeFN($id); }else{ - $ext = mimetype($id); - $name = substr($id,0, -1*strlen($ext[0])-1); + $ext = mimetype($id); + $name = substr($id,0, -1*strlen($ext[0])-1); $fn = $conf['mediaolddir'].'/'.utf8_encodeFN($name .'.'.( (int) $rev ).'.'.$ext[0]); } return $fn; } /** - * Returns the full filepath to a localized textfile if local + * Returns the full filepath to a localized file if local * version isn't found the english one is returned * + * @param string $id The id of the local file + * @param string $ext The file extension (usually txt) * @author Andreas Gohr */ -function localeFN($id){ +function localeFN($id,$ext='txt'){ global $conf; - $file = DOKU_CONF.'/lang/'.$conf['lang'].'/'.$id.'.txt'; + $file = DOKU_CONF.'/lang/'.$conf['lang'].'/'.$id.'.'.$ext; if(!@file_exists($file)){ - $file = DOKU_INC.'inc/lang/'.$conf['lang'].'/'.$id.'.txt'; + $file = DOKU_INC.'inc/lang/'.$conf['lang'].'/'.$id.'.'.$ext; if(!@file_exists($file)){ //fall back to english - $file = DOKU_INC.'inc/lang/en/'.$id.'.txt'; + $file = DOKU_INC.'inc/lang/en/'.$id.'.'.$ext; } } return $file; -- cgit v1.2.3 From f08086ec453c4529ae7361f9540b430ee61238f0 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 13 Nov 2011 12:37:45 +0100 Subject: Added HTML wrapper for mails The mailwrap.html adds the standard headers and footers to all HTML mails. The signature present in the text body will be removed before inserting in the wrapper, allowing a nicer footer for HTML. Users can overwrite the file with their own to create HTML mails in corporate design. However, a way to automatically embed referenced images is missing currently. --- inc/Mailer.class.php | 15 +++++++++++---- inc/lang/en/mailwrap.html | 13 +++++++++++++ 2 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 inc/lang/en/mailwrap.html (limited to 'inc') diff --git a/inc/Mailer.class.php b/inc/Mailer.class.php index 09e457243..cdd4b266a 100644 --- a/inc/Mailer.class.php +++ b/inc/Mailer.class.php @@ -130,13 +130,13 @@ class Mailer { * If you pass the HTML part or HTML replacements yourself you have to make * sure you encode all HTML special chars correctly * - * @fixme the HTML head and body still needs to be set * @param string $text plain text body * @param array $textrep replacements to apply on the text part * @param array $htmlrep replacements to apply on the HTML part, leave null to use $textrep * @param array $html the HTML body, leave null to create it from $text + * @param bool $wrap wrap the HTML in the default header/Footer */ - public function setBody($text, $textrep=null, $htmlrep=null, $html=null){ + public function setBody($text, $textrep=null, $htmlrep=null, $html=null, $wrap=true){ global $INFO; global $conf; $htmlrep = (array) $htmlrep; @@ -147,6 +147,12 @@ class Mailer { $html = hsc($text); $html = nl2br($text); } + if($wrap){ + $wrap = rawLocale('mailwrap','html'); + $html = preg_replace('/\n-- \n.*$/m','',$html); //strip signature + $html = str_replace('@HTMLBODY@',$html,$wrap); + } + // copy over all replacements missing for HTML (autolink URLs) foreach($textrep as $key => $value){ if(isset($htmlrep[$key])) continue; @@ -159,11 +165,12 @@ class Mailer { // prepare default replacements $ip = clientIP(); + $cip = gethostsbyaddrs($ip); $trep = array( 'DATE' => dformat(), 'BROWSER' => $_SERVER['HTTP_USER_AGENT'], 'IPADDRESS' => $ip, - 'HOSTNAME' => gethostsbyaddrs($ip), + 'HOSTNAME' => $cip, 'TITLE' => $conf['title'], 'DOKUWIKIURL' => DOKU_URL, 'USER' => $_SERVER['REMOTE_USER'], @@ -175,7 +182,7 @@ class Mailer { 'DATE' => ''.hsc(dformat()).'', 'BROWSER' => hsc($_SERVER['HTTP_USER_AGENT']), 'IPADDRESS' => ''.hsc($ip).'', - 'HOSTNAME' => ''.hsc(gethostsbyaddrs($ip)).'', + 'HOSTNAME' => ''.hsc($cip).'', 'TITLE' => hsc($conf['title']), 'DOKUWIKIURL' => ''.DOKU_URL.'', 'USER' => hsc($_SERVER['REMOTE_USER']), diff --git a/inc/lang/en/mailwrap.html b/inc/lang/en/mailwrap.html new file mode 100644 index 000000000..d67644c95 --- /dev/null +++ b/inc/lang/en/mailwrap.html @@ -0,0 +1,13 @@ + + + @TITLE@ + + + + +@HTMLBODY@ + +


+This mail was generated by DokuWiki at @DOKUWIKIURL@. + + -- cgit v1.2.3 From 850dbf1f4b1e2bdee8b2e5f0438a5625d0a1bedf Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 13 Nov 2011 13:06:07 +0100 Subject: allow image embeds in HTML mail templates Using the place holder @MEDIA()@ you now can directly embed images from the media repository into your HTML mail template. An example was added to the mailwrap.html, but because images are embedded as is (no prescaling) this is suboptimal. If we keep it, a smaller version of the DokuWiki logo should be shipped with DokuWiki. --- inc/Mailer.class.php | 22 ++++++++++++++++++++++ inc/lang/en/mailwrap.html | 1 + 2 files changed, 23 insertions(+) (limited to 'inc') diff --git a/inc/Mailer.class.php b/inc/Mailer.class.php index cdd4b266a..7e6889292 100644 --- a/inc/Mailer.class.php +++ b/inc/Mailer.class.php @@ -86,6 +86,24 @@ class Mailer { ); } + /** + * Callback function to automatically embed images referenced in HTML templates + */ + protected function autoembed_cb($matches){ + static $embeds = 0; + $embeds++; + + // get file and mime type + $media = cleanID($matches[1]); + list($ext, $mime) = mimetype($media); + $file = mediaFN($media); + if(!file_exists($file)) return $matches[0]; //bad reference, keep as is + + // attach it and set placeholder + $this->attachFile($file,$mime,'','autoembed'.$embeds); + return '%%autoembed'.$embeds.'%%'; + } + /** * Add an arbitrary header to the mail * @@ -163,6 +181,10 @@ class Mailer { } } + // embed media from templates + $html = preg_replace_callback('/@MEDIA\(([^\)]+)\)@/', + array($this,'autoembed_cb'),$html); + // prepare default replacements $ip = clientIP(); $cip = gethostsbyaddrs($ip); diff --git a/inc/lang/en/mailwrap.html b/inc/lang/en/mailwrap.html index d67644c95..00daf29ac 100644 --- a/inc/lang/en/mailwrap.html +++ b/inc/lang/en/mailwrap.html @@ -8,6 +8,7 @@ @HTMLBODY@


+DokuWiki This mail was generated by DokuWiki at @DOKUWIKIURL@. -- cgit v1.2.3 From b796e32e30bfcda629ebcf2a86550c6371839b0d Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 4 Mar 2012 17:43:51 +0100 Subject: fixed missing replacement for HTML notify mails --- inc/common.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc') diff --git a/inc/common.php b/inc/common.php index 1d8061ab0..a75d452a0 100644 --- a/inc/common.php +++ b/inc/common.php @@ -1147,7 +1147,7 @@ function notify($id,$who,$rev='',$summary='',$minor=false,$replace=array()){ $mail->to($to); $mail->bcc($bcc); $mail->subject($subject); - $mail->setBody($text,$trep); + $mail->setBody($text,$trep,$hrep); return $mail->send(); } -- cgit v1.2.3 From 45992a638a85374bf0df1084b3657c845abec060 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 9 Mar 2012 07:58:02 +0100 Subject: fixed mailprefix handling --- inc/Mailer.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'inc') diff --git a/inc/Mailer.class.php b/inc/Mailer.class.php index 7e6889292..5a5e7f2c6 100644 --- a/inc/Mailer.class.php +++ b/inc/Mailer.class.php @@ -500,7 +500,7 @@ class Mailer { } } - if(isset($subject)){ + if(isset($this->headers['Subject'])){ // add prefix to subject if(empty($conf['mailprefix'])){ if(utf8_strlen($conf['title']) < 20) { @@ -512,17 +512,17 @@ class Mailer { $prefix = '['.$conf['mailprefix'].']'; } $len = strlen($prefix); - if(substr($this->headers['subject'],0,$len) != $prefix){ - $this->headers['subject'] = $prefix.' '.$this->headers['subject']; + if(substr($this->headers['Subject'],0,$len) != $prefix){ + $this->headers['Subject'] = $prefix.' '.$this->headers['Subject']; } // encode subject if(defined('MAILHEADER_ASCIIONLY')){ - $this->headers['subject'] = utf8_deaccent($this->headers['subject']); - $this->headers['subject'] = utf8_strip($this->headers['subject']); + $this->headers['Subject'] = utf8_deaccent($this->headers['Subject']); + $this->headers['Subject'] = utf8_strip($this->headers['Subject']); } if(!utf8_isASCII($this->headers['Subject'])){ - $subject = '=?UTF-8?B?'.base64_encode($this->headers['Subject']).'?='; + $this->headers['Subject'] = '=?UTF-8?B?'.base64_encode($this->headers['Subject']).'?='; } } -- cgit v1.2.3 From a4c4a73d78c4db014dbc66ea67968472d52708f9 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 9 Mar 2012 08:02:27 +0100 Subject: fixed signature stripping --- inc/Mailer.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc') diff --git a/inc/Mailer.class.php b/inc/Mailer.class.php index 5a5e7f2c6..753ea3fd6 100644 --- a/inc/Mailer.class.php +++ b/inc/Mailer.class.php @@ -167,7 +167,7 @@ class Mailer { } if($wrap){ $wrap = rawLocale('mailwrap','html'); - $html = preg_replace('/\n-- \n.*$/m','',$html); //strip signature + $html = preg_replace('/\n--
.*$/s','',$html); //strip signature $html = str_replace('@HTMLBODY@',$html,$wrap); } -- cgit v1.2.3 From 47a906ead4a9ea1105bd2d1038b64b7bd0d67b76 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 9 Mar 2012 09:17:01 +0100 Subject: use inlinestyles for diffs in HTML mails --- inc/DifferenceEngine.php | 61 +++++++++++++++++++++++++++++++++++++----------- inc/common.php | 4 ++++ 2 files changed, 51 insertions(+), 14 deletions(-) (limited to 'inc') diff --git a/inc/DifferenceEngine.php b/inc/DifferenceEngine.php index 6e1d07382..52dca32c8 100644 --- a/inc/DifferenceEngine.php +++ b/inc/DifferenceEngine.php @@ -818,6 +818,39 @@ class DiffFormatter { } } +/** + * Utilityclass for styling HTML formatted diffs + * + * Depends on global var $DIFF_INLINESTYLES, if true some minimal predefined + * inline styles are used. Useful for HTML mails and RSS feeds + * + * @author Andreas Gohr + */ +class HTMLDiff { + /** + * Holds the style names and basic CSS + */ + static public $styles = array( + 'diff-addedline' => 'background-color: #ddffdd;', + 'diff-deletedline' => 'background-color: #ffdddd;', + 'diff-context' => 'background-color: #f5f5f5;', + 'diff-mark' => 'color: #ff0000;', + ); + + /** + * Return a class or style parameter + */ + static function css($classname){ + global $DIFF_INLINESTYLES; + + if($DIFF_INLINESTYLES){ + if(!isset(self::$styles[$classname])) return ''; + return 'style="'.self::$styles[$classname].'"'; + }else{ + return 'class="'.$classname.'"'; + } + } +} /** * Additions by Axel Boldt follow, partly taken from diff.php, phpwiki-1.3.3 @@ -838,11 +871,11 @@ class _HWLDF_WordAccumulator { function _flushGroup($new_tag) { if ($this->_group !== '') { if ($this->_tag == 'mark') - $this->_line .= ''.$this->_group.''; + $this->_line .= ''.$this->_group.''; elseif ($this->_tag == 'add') - $this->_line .= ''.$this->_group.''; + $this->_line .= ''.$this->_group.''; elseif ($this->_tag == 'del') - $this->_line .= ''.$this->_group.''; + $this->_line .= ''.$this->_group.''; else $this->_line .= $this->_group; } @@ -1020,8 +1053,8 @@ class TableDiffFormatter extends DiffFormatter { global $lang; $l1 = $lang['line'].' '.$xbeg; $l2 = $lang['line'].' '.$ybeg; - $r = ''.$l1.":\n". - ''.$l2.":\n". + $r = ''.$l1.":\n". + ''.$l2.":\n". "\n"; return $r; } @@ -1037,11 +1070,11 @@ class TableDiffFormatter extends DiffFormatter { } function addedLine($line) { - return '+' . $line.''; + return '+' . $line.''; } function deletedLine($line) { - return '-' . $line.''; + return '-' . $line.''; } function emptyLine() { @@ -1049,7 +1082,7 @@ class TableDiffFormatter extends DiffFormatter { } function contextLine($line) { - return ' '.$line.''; + return ' '.$line.''; } function _added($lines) { @@ -1115,9 +1148,9 @@ class InlineDiffFormatter extends DiffFormatter { $xbeg .= "," . $xlen; if ($ylen != 1) $ybeg .= "," . $ylen; - $r = '@@ '.$lang['line']." -$xbeg +$ybeg @@"; - $r .= ' '.$lang['deleted'].''; - $r .= ' '.$lang['created'].''; + $r = '@@ '.$lang['line']." -$xbeg +$ybeg @@"; + $r .= ' '.$lang['deleted'].''; + $r .= ' '.$lang['created'].''; $r .= "\n"; return $r; } @@ -1134,19 +1167,19 @@ class InlineDiffFormatter extends DiffFormatter { function _added($lines) { foreach ($lines as $line) { - print(''. $line . "\n"); + print(''. $line . "\n"); } } function _deleted($lines) { foreach ($lines as $line) { - print('' . $line . "\n"); + print('' . $line . "\n"); } } function _context($lines) { foreach ($lines as $line) { - print(''.$line."\n"); + print(''.$line."\n"); } } diff --git a/inc/common.php b/inc/common.php index a75d452a0..5e2bb7c93 100644 --- a/inc/common.php +++ b/inc/common.php @@ -1086,6 +1086,7 @@ function notify($id,$who,$rev='',$summary='',$minor=false,$replace=array()){ global $lang; global $conf; global $INFO; + global $DIFF_INLINESTYLES; // decide if there is something to do, eg. whom to mail if($who == 'admin'){ @@ -1131,8 +1132,11 @@ function notify($id,$who,$rev='',$summary='',$minor=false,$replace=array()){ explode("\n",rawWiki($id))); $dformat = new UnifiedDiffFormatter(); $tdiff = $dformat->format($df); + + $DIFF_INLINESTYLES = true; $dformat = new InlineDiffFormatter(); $hdiff = $dformat->format($df); + $DIFF_INLINESTYLES = false; }else{ $subject = $lang['mail_newpage'].' '.$id; $trep['OLDPAGE'] = '---'; -- cgit v1.2.3 From d2113a3cac4f670858d94dc53de4f653828dac91 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 9 Mar 2012 09:19:30 +0100 Subject: removed footer image from HTML mails --- inc/lang/en/mailwrap.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'inc') diff --git a/inc/lang/en/mailwrap.html b/inc/lang/en/mailwrap.html index 00daf29ac..f9f80fd80 100644 --- a/inc/lang/en/mailwrap.html +++ b/inc/lang/en/mailwrap.html @@ -7,8 +7,7 @@ @HTMLBODY@ -


-DokuWiki +

This mail was generated by DokuWiki at @DOKUWIKIURL@. -- cgit v1.2.3 From 9f3eca0b520fc5f689170108fbcbf490d12f2c2e Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 9 Mar 2012 12:44:28 +0100 Subject: Add various headers to the mails FS#2247. pull request #83 closed --- inc/Mailer.class.php | 23 ++++++++++++++++------- inc/common.php | 7 +++++++ inc/subscription.php | 6 +++++- 3 files changed, 28 insertions(+), 8 deletions(-) (limited to 'inc') diff --git a/inc/Mailer.class.php b/inc/Mailer.class.php index 753ea3fd6..141b69a18 100644 --- a/inc/Mailer.class.php +++ b/inc/Mailer.class.php @@ -33,14 +33,23 @@ class Mailer { * Initializes the boundary strings and part counters */ public function __construct(){ - if(isset($_SERVER['SERVER_NAME'])){ - $server = $_SERVER['SERVER_NAME']; - }else{ - $server = 'localhost'; - } + global $conf; + + $server = parse_url(DOKU_URL,PHP_URL_HOST); $this->partid = md5(uniqid(rand(),true)).'@'.$server; $this->boundary = '----------'.md5(uniqid(rand(),true)); + + $listid = join('.',array_reverse(explode('/',DOKU_BASE))).$server; + $listid = strtolower(trim($listid,'.')); + + // add some default headers for mailfiltering FS#2247 + $this->setHeader('X-Mailer','DokuWiki '.getVersion()); + $this->setHeader('X-DokuWiki-User', $_SERVER['REMOTE_USER']); + $this->setHeader('X-DokuWiki-Title', $conf['title']); + $this->setHeader('X-DokuWiki-Server', $server); + $this->setHeader('X-Auto-Response-Suppress', 'OOF'); + $this->setHeader('List-Id',$conf['title'].' <'.$listid.'>'); } /** @@ -114,10 +123,10 @@ class Mailer { * @param bool $clean remove all non-ASCII chars and line feeds? */ public function setHeader($header,$value,$clean=true){ - $header = ucwords(strtolower($header)); // streamline casing + $header = str_replace(' ','-',ucwords(strtolower(str_replace('-',' ',$header)))); // streamline casing if($clean){ $header = preg_replace('/[^\w \-\.\+\@]+/','',$header); - $value = preg_replace('/[^\w \-\.\+\@]+/','',$value); + $value = preg_replace('/[^\w \-\.\+\@<>]+/','',$value); } // empty value deletes diff --git a/inc/common.php b/inc/common.php index 5e2bb7c93..79646eadc 100644 --- a/inc/common.php +++ b/inc/common.php @@ -1152,6 +1152,13 @@ function notify($id,$who,$rev='',$summary='',$minor=false,$replace=array()){ $mail->bcc($bcc); $mail->subject($subject); $mail->setBody($text,$trep,$hrep); + if($who == 'subscribers'){ + $mail->setHeader( + 'List-Unsubscribe', + '<'.wl($id,array('do'=>'subscribe'),true,'&').'>', + false + ); + } return $mail->send(); } diff --git a/inc/subscription.php b/inc/subscription.php index e9f17bc28..d1ee0397a 100644 --- a/inc/subscription.php +++ b/inc/subscription.php @@ -387,6 +387,10 @@ function subscription_send($subscriber_mail, $replaces, $subject, $id, $template $mail->bcc($subscriber_mail); $mail->subject($subject); $mail->setBody($text,$trep); - + $mail->setHeader( + 'List-Unsubscribe', + '<'.wl($id,array('do'=>'subscribe'),true,'&').'>', + false + ); return $mail->send(); } -- cgit v1.2.3 From ba9c057b0126f2c449e16adf5073920b5a663773 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 9 Mar 2012 12:50:34 +0100 Subject: use real HRs in HTML mails --- inc/Mailer.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'inc') diff --git a/inc/Mailer.class.php b/inc/Mailer.class.php index 141b69a18..d7dc70ded 100644 --- a/inc/Mailer.class.php +++ b/inc/Mailer.class.php @@ -171,8 +171,10 @@ class Mailer { // create HTML from text if not given if(is_null($html)){ - $html = hsc($text); - $html = nl2br($text); + $html = $text; + $html = hsc($html); + $html = preg_replace('/^-----*$/m','
',$html); + $html = nl2br($html); } if($wrap){ $wrap = rawLocale('mailwrap','html'); -- cgit v1.2.3 From 6e87cfd37115039280bb5d88291d188c94b07a38 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 9 Mar 2012 12:50:47 +0100 Subject: fixed subscriber mail signatures --- inc/lang/en/subscr_digest.txt | 2 +- inc/lang/en/subscr_list.txt | 2 +- inc/lang/en/subscr_single.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'inc') diff --git a/inc/lang/en/subscr_digest.txt b/inc/lang/en/subscr_digest.txt index fac8564bd..35011b6e6 100644 --- a/inc/lang/en/subscr_digest.txt +++ b/inc/lang/en/subscr_digest.txt @@ -15,6 +15,6 @@ To cancel the page notifications, log into the wiki at @SUBSCRIBE@ and unsubscribe page and/or namespace changes. --- +-- This mail was generated by DokuWiki at @DOKUWIKIURL@ diff --git a/inc/lang/en/subscr_list.txt b/inc/lang/en/subscr_list.txt index efe27d866..4c38b9326 100644 --- a/inc/lang/en/subscr_list.txt +++ b/inc/lang/en/subscr_list.txt @@ -12,6 +12,6 @@ To cancel the page notifications, log into the wiki at @SUBSCRIBE@ and unsubscribe page and/or namespace changes. --- +-- This mail was generated by DokuWiki at @DOKUWIKIURL@ diff --git a/inc/lang/en/subscr_single.txt b/inc/lang/en/subscr_single.txt index f2abe6d77..673c4c32a 100644 --- a/inc/lang/en/subscr_single.txt +++ b/inc/lang/en/subscr_single.txt @@ -18,6 +18,6 @@ To cancel the page notifications, log into the wiki at @NEWPAGE@ and unsubscribe page and/or namespace changes. --- +-- This mail was generated by DokuWiki at @DOKUWIKIURL@ -- cgit v1.2.3 From 04058413cc2649aa16f5bfe605270e8e5d4536f3 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Wed, 14 Mar 2012 10:40:25 +0100 Subject: add missing table tags for HTML diff mails --- inc/common.php | 1 + 1 file changed, 1 insertion(+) (limited to 'inc') diff --git a/inc/common.php b/inc/common.php index 79646eadc..d19147387 100644 --- a/inc/common.php +++ b/inc/common.php @@ -1136,6 +1136,7 @@ function notify($id,$who,$rev='',$summary='',$minor=false,$replace=array()){ $DIFF_INLINESTYLES = true; $dformat = new InlineDiffFormatter(); $hdiff = $dformat->format($df); + $hdiff = ''.$hdiff.'
'; $DIFF_INLINESTYLES = false; }else{ $subject = $lang['mail_newpage'].' '.$id; -- cgit v1.2.3 From 052b2a1780ce07c45e80cd16a55e43177850de35 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 23 Mar 2012 11:39:25 +0100 Subject: removed commented code left from the quoted_printable days --- inc/Mailer.class.php | 9 --------- 1 file changed, 9 deletions(-) (limited to 'inc') diff --git a/inc/Mailer.class.php b/inc/Mailer.class.php index d7dc70ded..9744fa44e 100644 --- a/inc/Mailer.class.php +++ b/inc/Mailer.class.php @@ -370,15 +370,6 @@ class Mailer { } if(!utf8_isASCII($text)){ - //FIXME check if this is needed for base64 too - // put the quotes outside as in =?UTF-8?Q?"Elan Ruusam=C3=A4e"?= vs "=?UTF-8?Q?Elan Ruusam=C3=A4e?=" - /* - if (preg_match('/^"(.+)"$/', $text, $matches)) { - $text = '"=?UTF-8?Q?'.mail_quotedprintable_encode($matches[1], 0).'?="'; - } else { - $text = '=?UTF-8?Q?'.mail_quotedprintable_encode($text, 0).'?='; - } - */ $text = '=?UTF-8?B?'.base64_encode($text).'?='; } }else{ -- cgit v1.2.3 From 2398a2b54196667d6659d3d0489212b271c43703 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 15 Apr 2012 13:25:05 +0200 Subject: made it possible to disable HTML mails in the config --- inc/Mailer.class.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'inc') diff --git a/inc/Mailer.class.php b/inc/Mailer.class.php index 9744fa44e..f04cdd3e2 100644 --- a/inc/Mailer.class.php +++ b/inc/Mailer.class.php @@ -26,6 +26,7 @@ class Mailer { private $sendparam= null; private $validator = null; + private $allowhtml = true; /** * Constructor @@ -43,6 +44,8 @@ class Mailer { $listid = join('.',array_reverse(explode('/',DOKU_BASE))).$server; $listid = strtolower(trim($listid,'.')); + $this->allowhtml = (bool) $conf['htmlmail']; + // add some default headers for mailfiltering FS#2247 $this->setHeader('X-Mailer','DokuWiki '.getVersion()); $this->setHeader('X-DokuWiki-User', $_SERVER['REMOTE_USER']); @@ -434,6 +437,11 @@ class Mailer { protected function prepareBody(){ global $conf; + // no HTML mails allowed? remove HTML body + if(!$this->allowhtml){ + $this->html = ''; + } + // check for body if(!$this->text && !$this->html){ return false; -- cgit v1.2.3 From f41c79d730286e8e8c95deb88a4c876e08e278a2 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 15 Apr 2012 13:26:57 +0200 Subject: changed internal Mailer members from private to protected --- inc/Mailer.class.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'inc') diff --git a/inc/Mailer.class.php b/inc/Mailer.class.php index f04cdd3e2..507150d00 100644 --- a/inc/Mailer.class.php +++ b/inc/Mailer.class.php @@ -16,17 +16,17 @@ if(!defined('MAILHEADER_EOL')) define('MAILHEADER_EOL',"\n"); class Mailer { - private $headers = array(); - private $attach = array(); - private $html = ''; - private $text = ''; + protected $headers = array(); + protected $attach = array(); + protected $html = ''; + protected $text = ''; - private $boundary = ''; - private $partid = ''; - private $sendparam= null; + protected $boundary = ''; + protected $partid = ''; + protected $sendparam= null; - private $validator = null; - private $allowhtml = true; + protected $validator = null; + protected $allowhtml = true; /** * Constructor -- cgit v1.2.3 From 50da7978b031b566117cfe95fa7341d506207766 Mon Sep 17 00:00:00 2001 From: Usama Akkad Date: Wed, 11 Apr 2012 23:02:09 +0200 Subject: Arabic Language Update --- inc/lang/ar/lang.php | 54 +++++++++++++++++++++++++++++++++++++++++++++++- inc/lang/ar/resetpwd.txt | 3 +++ 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 inc/lang/ar/resetpwd.txt (limited to 'inc') diff --git a/inc/lang/ar/lang.php b/inc/lang/ar/lang.php index af92243c9..350e26695 100644 --- a/inc/lang/ar/lang.php +++ b/inc/lang/ar/lang.php @@ -42,11 +42,14 @@ $lang['btn_backtomedia'] = 'ارجع إلى اختيار ملف الوسا $lang['btn_subscribe'] = 'ادر الاشتراكات'; $lang['btn_profile'] = 'حدث الملف الشخصي'; $lang['btn_reset'] = 'صفّر'; +$lang['btn_resendpwd'] = 'اضبط كلمة سر جديدة'; $lang['btn_draft'] = 'حرر المسودة'; $lang['btn_recover'] = 'استرجع المسودة'; $lang['btn_draftdel'] = 'احذف المسوّدة'; $lang['btn_revert'] = 'استعد'; $lang['btn_register'] = 'سجّل'; +$lang['btn_apply'] = 'طبق'; +$lang['btn_media'] = 'مدير الوسائط'; $lang['loggedinas'] = 'داخل باسم'; $lang['user'] = 'اسم المستخدم'; $lang['pass'] = 'كلمة السر'; @@ -76,6 +79,7 @@ $lang['profnoempty'] = 'غير مسموح باسم مستخدم أو $lang['profchanged'] = 'حُدث الملف الشخصي للمستخدم بنجاح.'; $lang['pwdforget'] = 'أنسيت كلمة السر؟ احصل على واحدة جديدة'; $lang['resendna'] = 'هذه الويكي لا تدعم إعادة إرسال كلمة المرور.'; +$lang['resendpwd'] = 'اضبط كلمة سر جديدة لـ'; $lang['resendpwdmissing'] = 'عذراّ، يجب أن تملأ كل الحقول.'; $lang['resendpwdnouser'] = 'عذراً، لم نجد المستخدم هذا في قاعدة بياناتنا.'; $lang['resendpwdbadauth'] = 'عذراً، رمز التفعيل هذا غير صحيح. نأكد من استخدامك كامل وصلة التأكيد.'; @@ -90,7 +94,7 @@ $lang['txt_filename'] = 'رفع كـ (اختياري)'; $lang['txt_overwrt'] = 'اكتب على ملف موجود'; $lang['lockedby'] = 'مقفلة حاليا لـ'; $lang['lockexpire'] = 'ينتهي القفل في'; -$lang['js']['willexpire'] = 'سينتهي قفل تحرير هذه الصفحه خلال دقيقة.\nلتجنب التعارض استخدم زر المعاينة لتصفير مؤقت القفل.'; +$lang['js']['willexpire'] = 'سينتهي قفل تحرير هذه الصفحه خلال دقيقة.\nلتجنب التعارض استخدم زر المعاينة لتصفير مؤقت القفل.'; $lang['js']['notsavedyet'] = 'التعديلات غير المحفوظة ستفقد.'; $lang['js']['searchmedia'] = 'ابحث عن ملفات'; $lang['js']['keepopen'] = 'أبقي النافذة مفتوحة أثناء الاختيار'; @@ -121,6 +125,17 @@ $lang['js']['nosmblinks'] = 'الروابط لمجلدات مشاركة و $lang['js']['linkwiz'] = 'مرشد الروابط'; $lang['js']['linkto'] = 'الرابط إلى :'; $lang['js']['del_confirm'] = 'هل حقاً تريد حذف البنود المختارة؟'; +$lang['js']['restore_confirm'] = 'أمتأكد من استرجاع هذه النسخة؟'; +$lang['js']['media_diff'] = 'عرض الفروق:'; +$lang['js']['media_diff_both'] = 'جنبا إلى جنب'; +$lang['js']['media_diff_opacity'] = 'Shine-through'; +$lang['js']['media_diff_portions'] = 'Swipe'; +$lang['js']['media_select'] = 'اختر ملفا...'; +$lang['js']['media_upload_btn'] = 'ارفع'; +$lang['js']['media_done_btn'] = 'تم'; +$lang['js']['media_drop'] = 'اسقط الملف هنا لرفعه'; +$lang['js']['media_cancel'] = 'أزل'; +$lang['js']['media_overwrt'] = 'أكتب فوق الملفات الموجودة'; $lang['rssfailed'] = 'خطأ ما حدث أثناء جلب ملف التغذية:'; $lang['nothingfound'] = 'لا يوجد شيء'; $lang['mediaselect'] = 'ملفات الوسائط'; @@ -170,11 +185,20 @@ $lang['external_edit'] = 'تحرير خارجي'; $lang['summary'] = 'ملخص التحرير'; $lang['noflash'] = 'تحتاج إلىملحق فلاش أدوبي لعرض هذا المحتوى.'; $lang['download'] = 'نزل Snippet'; +$lang['tools'] = 'أدوات'; +$lang['user_tools'] = 'أدوات المستخدم'; +$lang['site_tools'] = 'أدوات الموقع'; +$lang['page_tools'] = 'أدوات الصفحة'; +$lang['skip_to_content'] = 'تجاوز إلى المحتوى'; $lang['mail_newpage'] = 'إضافة صفحة:'; $lang['mail_changed'] = 'تعديل صفحة:'; $lang['mail_subscribe_list'] = 'صفحات غيرت في النطاق:'; $lang['mail_new_user'] = 'مشترك جديد:'; $lang['mail_upload'] = 'رفع ملف:'; +$lang['changes_type'] = 'أظهر تغييرات الـ'; +$lang['pages_changes'] = 'صفحات'; +$lang['media_changes'] = 'ملفات الوسائط'; +$lang['both_changes'] = 'كلا من الصفحات وملفات الوسائط'; $lang['qb_bold'] = 'نص عريض'; $lang['qb_italic'] = 'نص مائل'; $lang['qb_underl'] = 'نص مسطر'; @@ -215,6 +239,9 @@ $lang['img_copyr'] = 'حقوق النسخ'; $lang['img_format'] = 'الهيئة'; $lang['img_camera'] = 'الكمرا'; $lang['img_keywords'] = 'كلمات مفتاحية'; +$lang['img_width'] = 'العرض'; +$lang['img_height'] = 'الإرتفاع'; +$lang['img_manager'] = 'اعرض في مدير الوسائط'; $lang['subscr_subscribe_success'] = 'اضيف %s لقائمة اشتراك %s'; $lang['subscr_subscribe_error'] = 'خطأ في إضافة %s لقائمة اشتراك %s'; $lang['subscr_subscribe_noaddress'] = 'ليس هناك عنوان مرتبط بولوجك، لا يمكن اضافتك لقائمة الاشتراك'; @@ -233,6 +260,7 @@ $lang['subscr_style_digest'] = 'بريد ملخص عن تغييرات كل ص $lang['subscr_style_list'] = 'قائمة بالصفحات المتغيرة منذ آخر بريد'; $lang['authmodfailed'] = 'إعدادات تصريح فاسدة، يرجى مراسلة المدير.'; $lang['authtempfail'] = 'تصريح المشترك غير متوفر مؤقتاً، إن استمرت هذه الحالة يرجى مراسلة المدير'; +$lang['authpwdexpire'] = 'ستنتهي صلاحية كلمة السر في %d . عليك بتغييرها سريعا.'; $lang['i_chooselang'] = 'اختر لغتك'; $lang['i_installer'] = 'برنامج تنصيب دوكو ويكي'; $lang['i_wikiname'] = 'اسم الويكي'; @@ -273,3 +301,27 @@ $lang['hours'] = '%d ساعة مضت'; $lang['minutes'] = '%d دقيقة مضت'; $lang['seconds'] = '%d ثانية مضت'; $lang['wordblock'] = 'لم تحفظ تغييراتك لاحتوائها على نص ممنوع )غثاء('; +$lang['media_uploadtab'] = 'ارفع'; +$lang['media_searchtab'] = 'ابحث'; +$lang['media_file'] = 'ملف'; +$lang['media_viewtab'] = 'عرض'; +$lang['media_edittab'] = 'تحرير'; +$lang['media_historytab'] = 'التاريخ'; +$lang['media_list_thumbs'] = 'المصغرات'; +$lang['media_list_rows'] = 'صفوف'; +$lang['media_sort_name'] = 'الاسم'; +$lang['media_sort_date'] = 'التاريخ'; +$lang['media_namespaces'] = 'اختر نطاقا'; +$lang['media_files'] = 'الملفات في %s'; +$lang['media_upload'] = 'ارفع إلى %s'; +$lang['media_search'] = 'ابحث في %s'; +$lang['media_view'] = '%s'; +$lang['media_viewold'] = '%s في %s'; +$lang['media_edit'] = 'حرر %s'; +$lang['media_history'] = 'تاريخ %s'; +$lang['media_meta_edited'] = 'عُدلت الميتاداتا'; +$lang['media_perm_read'] = 'عفوا، لست مخولا بقراءة الملفات.'; +$lang['media_perm_upload'] = 'عفوا، لست مخولا برفع الملفات.'; +$lang['media_update'] = 'ارفع إصدارا أحدث'; +$lang['media_restore'] = 'استرجع هذه النسخة'; +$lang['plugin_install_err'] = 'ثبتت الإضافة بشكل خاطئ. أعد تسمية دليل الإضافة \'%s\' إلى \'%s\'.'; diff --git a/inc/lang/ar/resetpwd.txt b/inc/lang/ar/resetpwd.txt new file mode 100644 index 000000000..2bbd4a21a --- /dev/null +++ b/inc/lang/ar/resetpwd.txt @@ -0,0 +1,3 @@ +====== اضبط كلمة سر جديدة ====== + +أدخل كلمة سر جديدة لحسابك في هذه الويكي. -- cgit v1.2.3 From 28be31cd273e011d9c9b8ea7b7223497ec28ebd7 Mon Sep 17 00:00:00 2001 From: Tim Roes Date: Thu, 12 Apr 2012 22:23:09 +0200 Subject: Added page title to search results in Remote API --- inc/RemoteAPICore.php | 1 + 1 file changed, 1 insertion(+) (limited to 'inc') diff --git a/inc/RemoteAPICore.php b/inc/RemoteAPICore.php index 546832100..80deb7377 100644 --- a/inc/RemoteAPICore.php +++ b/inc/RemoteAPICore.php @@ -302,6 +302,7 @@ class RemoteAPICore { 'mtime' => filemtime($file), 'size' => filesize($file), 'snippet' => $snippet, + 'title' => p_get_first_heading($id) ); } return $pages; -- cgit v1.2.3 From c8095cd786d9a27b3f7ed2d55a463ac69020fcbb Mon Sep 17 00:00:00 2001 From: Tim Roes Date: Thu, 12 Apr 2012 23:29:24 +0200 Subject: Remote search is aware of useheading option --- inc/RemoteAPICore.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc') diff --git a/inc/RemoteAPICore.php b/inc/RemoteAPICore.php index 80deb7377..9da493210 100644 --- a/inc/RemoteAPICore.php +++ b/inc/RemoteAPICore.php @@ -302,7 +302,7 @@ class RemoteAPICore { 'mtime' => filemtime($file), 'size' => filesize($file), 'snippet' => $snippet, - 'title' => p_get_first_heading($id) + 'title' => useHeading('navigation') ? p_get_first_heading($id) : $id ); } return $pages; -- cgit v1.2.3 From 64676c5f790c644a1180b3cd35c0c4a8ecc2b24e Mon Sep 17 00:00:00 2001 From: Padmanabh Kulkarni Date: Sun, 15 Apr 2012 12:46:42 +0200 Subject: Marathi language update --- inc/lang/mr/lang.php | 82 ++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 70 insertions(+), 12 deletions(-) (limited to 'inc') diff --git a/inc/lang/mr/lang.php b/inc/lang/mr/lang.php index 96323394d..32781e6d4 100644 --- a/inc/lang/mr/lang.php +++ b/inc/lang/mr/lang.php @@ -44,13 +44,16 @@ $lang['btn_back'] = 'मागॆ'; $lang['btn_backlink'] = 'येथे काय जोडले आहे'; $lang['btn_backtomedia'] = 'परत माध्यम फाइल निवडीकड़े'; $lang['btn_subscribe'] = 'पृष्ठाच्या बदलांची पुरवणी (फीड) लावा '; -$lang['btn_unsubscribe'] = 'पृष्ठाच्या बदलांची पुरवणी (फीड) बंद करा'; $lang['btn_profile'] = 'प्रोफाइल अद्ययावत करा'; $lang['btn_reset'] = 'रिसेट'; +$lang['btn_resendpwd'] = 'नवीन पासवर्ड'; $lang['btn_draft'] = 'प्रत संपादन'; $lang['btn_recover'] = 'प्रत परत मिळवा'; $lang['btn_draftdel'] = 'प्रत रद्द'; +$lang['btn_revert'] = 'पुनर्स्थापन'; $lang['btn_register'] = 'नोंदणी'; +$lang['btn_apply'] = 'लागू'; +$lang['btn_media'] = 'मिडिया व्यवस्थापक'; $lang['loggedinas'] = 'लॉगिन नाव'; $lang['user'] = 'वापरकर्ता'; $lang['pass'] = 'परवलीचा शब्द'; @@ -81,19 +84,58 @@ $lang['profchanged'] = 'सदस्याची प्रोफाइ $lang['pwdforget'] = 'परवलीचा शब्द विसरला आहे का? नविन मागवा.'; $lang['resendna'] = 'ह्या विकी मधे परवलीचा शब्द परत पाथाव्न्याची सुविधा नाही.'; $lang['resendpwd'] = 'नविन परवली इच्छुक'; +$lang['resendpwdmissing'] = 'माफ करा, पण सर्व जागा भरल्या पाहिजेत.'; $lang['resendpwdnouser'] = 'माफ़ करा, हा सदस्य आमच्या माहितिसंग्रहात सापडला नाही.'; $lang['resendpwdbadauth'] = 'माफ़ करा, हा अधिकार कोड बरोबर नाही. कृपया आपण पूर्ण शिकामोर्तबाची लिंक वापरल्याची खात्री करा.'; $lang['resendpwdconfirm'] = 'शिक्कामोर्तबाची लिंक ईमेल द्वारा पाठवली आहे.'; $lang['resendpwdsuccess'] = 'शिक्कामोर्तबाची लिंक ईमेल द्वारा पाठवली आहे.'; $lang['license'] = 'विशिष्ठ नोंद केलि नसल्यास ह्या विकी वरील सर्व मजकूर खालील लायसन्स मधे मोडतो : '; $lang['licenseok'] = 'नोंद : हे पृष्ठ संपादित केल्यास तुम्ही तुमचे योगदान खालील लायसन्स अंतर्गत येइल : '; +$lang['searchmedia'] = 'फाईल शोधा:'; +$lang['searchmedia_in'] = '%s मधे शोधा'; $lang['txt_upload'] = 'अपलोड करण्याची फाइल निवडा'; $lang['txt_filename'] = 'अपलोड उर्फ़ ( वैकल्पिक )'; $lang['txt_overwrt'] = 'अस्तित्वात असलेल्या फाइलवरच सुरक्षित करा.'; $lang['lockedby'] = 'सध्या लॉक करणारा :'; $lang['lockexpire'] = 'सध्या लॉक करणारा :'; -$lang['js']['willexpire'] = 'हे पृष्ठ संपादित करण्यासाठी मिळालेले लॉक एखाद्या मिनिटात संपणार आहे.\n चुका होऊ नयेत म्हणुन कृपया प्रीव्यू बटन दाबुन लॉक ची वेळ पुन्हा चालू करा.'; -$lang['js']['notsavedyet'] = "सुरक्षित न केलेले बदल नष्ट होतील. नक्की करू का ?"; +$lang['js']['willexpire'] = 'हे पृष्ठ संपादित करण्यासाठी मिळालेले लॉक एखाद्या मिनिटात संपणार आहे.\n चुका होऊ नयेत म्हणुन कृपया प्रीव्यू बटन दाबुन लॉक ची वेळ पुन्हा चालू करा.'; +$lang['js']['notsavedyet'] = 'सुरक्षित न केलेले बदल नष्ट होतील. नक्की करू का ?'; +$lang['js']['searchmedia'] = 'फाईल्ससाठी शोधा'; +$lang['js']['keepopen'] = 'निवड केल्यावर विण्डो उघडी ठेवा'; +$lang['js']['hidedetails'] = 'सविस्तर मजकूर लपवा'; +$lang['js']['mediatitle'] = 'लिंक सेटिंग'; +$lang['js']['mediadisplay'] = 'लिंकचा प्रकार'; +$lang['js']['mediaalign'] = 'जुळवणी'; +$lang['js']['mediasize'] = 'प्रतिमेचा आकार'; +$lang['js']['mediatarget'] = 'लिंकचे लक्ष्य'; +$lang['js']['mediaclose'] = 'बंद'; +$lang['js']['mediadisplayimg'] = 'प्रतिमा दाखवा.'; +$lang['js']['mediadisplaylnk'] = 'फक्त लिंक दाखवा.'; +$lang['js']['mediasmall'] = 'लहान आवृत्ती'; +$lang['js']['mediamedium'] = 'माध्यम आवृत्ती'; +$lang['js']['medialarge'] = 'मोठी आवृत्ती'; +$lang['js']['mediaoriginal'] = 'मूळ आवृत्ती'; +$lang['js']['medialnk'] = 'सविस्तर माहितीकडेची लिंक'; +$lang['js']['mediadirect'] = 'मूळ मजकुराकडे थेट लिंक'; +$lang['js']['medianolnk'] = 'लिंक नको'; +$lang['js']['medianolink'] = 'प्रतिमा लिंक करू नका'; +$lang['js']['medialeft'] = 'प्रतिमा डाव्या बाजूला जुळवून घ्या.'; +$lang['js']['mediaright'] = 'प्रतिमा उजव्या बाजूला जुळवून घ्या.'; +$lang['js']['mediacenter'] = 'प्रतिमा मध्यभागी जुळवून घ्या.'; +$lang['js']['medianoalign'] = 'जुळवाजुळव वापरू नका.'; +$lang['js']['nosmblinks'] = 'विन्डोज़ शेअर ला लिंक केल्यास ते फक्त मायक्रोसॉफ़्ट इन्टरनेट एक्स्प्लोरर वरच चालते. तरी तुम्ही लिंक कॉपी करू शकता.'; +$lang['js']['linkwiz'] = 'लिंक जादूगार'; +$lang['js']['linkto'] = 'याला लिंक करा:'; +$lang['js']['del_confirm'] = 'निवडलेल्या गोष्टी नक्की नष्ट करू का ?'; +$lang['js']['restore_confirm'] = 'हि आवृत्ती खरोखर पुनर्स्थापित करू का?'; +$lang['js']['media_diff'] = 'फरक बघू:'; +$lang['js']['media_diff_both'] = 'बाजूबाजूला'; +$lang['js']['media_diff_portions'] = 'स्वाईप'; +$lang['js']['media_select'] = 'फाईल निवड...'; +$lang['js']['media_upload_btn'] = 'अपलोड'; +$lang['js']['media_done_btn'] = 'झालं'; +$lang['js']['media_drop'] = 'अपलोड करण्यासाठी इथे फाईल टाका'; +$lang['js']['media_cancel'] = 'काढा'; $lang['rssfailed'] = 'ही पुरवणी आणण्यात काही चूक झाली:'; $lang['nothingfound'] = 'काही सापडला नाही.'; $lang['mediaselect'] = 'दृकश्राव्य फाइल'; @@ -111,9 +153,7 @@ $lang['deletefail'] = '%s ही फाइल नष्ट करू $lang['mediainuse'] = '%s ही फाइल नष्ट केली नाही - ती अजुन वापरात आहे.'; $lang['namespaces'] = 'नेमस्पेस'; $lang['mediafiles'] = 'मध्ये उपलब्ध असलेल्या फाइल'; -$lang['js']['keepopen'] = 'निवड केल्यावर विण्डो उघडी ठेवा'; -$lang['js']['hidedetails'] = 'सविस्तर मजकूर लपवा'; -$lang['js']['nosmblinks'] = 'विन्डोज़ शेअर ला लिंक केल्यास ते फक्त मायक्रोसॉफ़्ट इन्टरनेट एक्स्प्लोरर वरच चालते. तरी तुम्ही लिंक कॉपी करू शकता.'; +$lang['accessdenied'] = 'तुम्हाला हे पान बघायची परवानगी नाही.'; $lang['mediausage'] = 'ह्या फाइलचा संदर्भ देण्यासाठी खालील सिन्टॅक्स वापरा :'; $lang['mediaview'] = 'मूळ फाइल बघू '; $lang['mediaroot'] = 'रूट'; @@ -129,6 +169,10 @@ $lang['current'] = 'चालू'; $lang['yours'] = 'तुमची आवृत्ति'; $lang['diff'] = 'सध्याच्या आवृत्तिंशी फरक दाखवा'; $lang['diff2'] = 'निवडलेल्या आवृत्तिंमधील फरक दाखवा'; +$lang['difflink'] = 'ह्या तुलना दृष्टीकोनाला लिंक करा'; +$lang['diff_type'] = 'फरक बघू:'; +$lang['diff_inline'] = 'एका ओळीत'; +$lang['diff_side'] = 'बाजूबाजूला'; $lang['line'] = 'ओळ'; $lang['breadcrumb'] = 'मागमूस'; $lang['youarehere'] = 'तुम्ही इथे आहात'; @@ -140,10 +184,21 @@ $lang['restored'] = 'जुनी आवृत्ति पुन $lang['external_edit'] = 'बाहेरून संपादित'; $lang['summary'] = 'सारांश बदला'; $lang['noflash'] = 'ही माहिती दाखवण्यासाठी अडोब फ्लॅश प्लेअर ची गरज आहे.'; +$lang['download'] = 'तुकडा डाउनलोड करा'; +$lang['tools'] = 'साधने'; +$lang['user_tools'] = 'युजरची साधने'; +$lang['site_tools'] = 'साईटची साधने'; +$lang['page_tools'] = 'पानाची साधने'; +$lang['skip_to_content'] = 'सरळ मजकुराकडे '; $lang['mail_newpage'] = 'पृष्ठ जोडले : '; $lang['mail_changed'] = 'पृष्ठ बदलले : '; +$lang['mail_subscribe_list'] = 'ह्या नेमस्पेस नाढे बदललेली पाने:'; $lang['mail_new_user'] = 'नवीन सदस्य : '; $lang['mail_upload'] = 'फाइल अपलोड केली : '; +$lang['changes_type'] = 'ह्याचे बदल बघू'; +$lang['pages_changes'] = 'पाने'; +$lang['media_changes'] = 'मिडिया फाईल'; +$lang['both_changes'] = 'पाने आणि मिडिया फाईल दोन्ही'; $lang['qb_bold'] = 'ठळक मजकूर'; $lang['qb_italic'] = 'तिरका मजकूर'; $lang['qb_underl'] = 'अधोरेखित मजकूर'; @@ -154,6 +209,11 @@ $lang['qb_h2'] = 'दुसर्या पातळीचे $lang['qb_h3'] = 'तिसर्या पातळीचे शीर्षक'; $lang['qb_h4'] = 'चवथ्या पातळीचे शीर्षक'; $lang['qb_h5'] = 'पाचव्या पातळीचे शीर्षक'; +$lang['qb_h'] = 'शीर्षक'; +$lang['qb_hs'] = 'शीर्षक निवड'; +$lang['qb_hplus'] = 'उंच शीर्षक'; +$lang['qb_hminus'] = 'खालचं शीर्षक'; +$lang['qb_hequal'] = 'समान लेवलचे शीर्षक'; $lang['qb_link'] = 'अंतर्गत लिंक'; $lang['qb_extlink'] = 'बाह्य लिंक'; $lang['qb_hr'] = 'आडवी पट्टी'; @@ -163,7 +223,7 @@ $lang['qb_media'] = 'प्रतिमा आणि इतर फ $lang['qb_sig'] = 'स्वाक्षरी टाका'; $lang['qb_smileys'] = 'स्माइली'; $lang['qb_chars'] = 'ख़ास चिन्ह'; -$lang['js']['del_confirm'] = 'निवडलेल्या गोष्टी नक्की नष्ट करू का ?'; +$lang['upperns'] = 'ह्यावरच्या नेमस्पेसकडे उडी मारा'; $lang['admin_register'] = 'नवीन सदस्य'; $lang['metaedit'] = 'मेटाडेटा बदला'; $lang['metasaveerr'] = 'मेटाडेटा सुरक्षित झाला नाही'; @@ -179,11 +239,9 @@ $lang['img_copyr'] = 'कॉपीराइट'; $lang['img_format'] = 'प्रकार'; $lang['img_camera'] = 'कॅमेरा'; $lang['img_keywords'] = 'मुख्य शब्द'; -$lang['subscribe_success'] = '%s ला %s च्या पुरवणिसाठि नोंदवले'; -$lang['subscribe_error'] = '%s ला %s च्या पुरवणिसाठि नोंदवताना चूक झाली'; -$lang['subscribe_noaddress'] = 'तुमच्या लॉगिनशी सम्बंधित कुठलाही पत्ता नाही , त्यामुळे पुरवणिसाठि नोंद केली जाऊ शकत नाही'; -$lang['unsubscribe_success'] = '%s ला %s च्या पुरवणी यादी मधून काढून टाकले'; -$lang['unsubscribe_error'] = '%s ला %s च्या पुरवणी यादी मधून काढून टाकण्यात चूक झाली'; +$lang['img_width'] = 'रुंदी'; +$lang['img_height'] = 'उंची'; +$lang['img_manager'] = 'मिडिया व्यवस्थापकात बघू'; $lang['authmodfailed'] = 'सदस्य अधिकृत करण्याची व्यवस्था चुकीची आहे. कृपया तुमच्या विकीच्या व्यवस्थापकाशी सम्पर्क साधा.'; $lang['authtempfail'] = 'सदस्य अधिकृत करण्याची सुविधा सध्या चालू नाही. सतत हा मजकूर दिसल्यास कृपया तुमच्या विकीच्या व्यवस्थापकाशी सम्पर्क साधा.'; $lang['i_chooselang'] = 'तुमची भाषा निवडा'; -- cgit v1.2.3 From a48c834625c8fb17e4081cfd6121f14042dcf468 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emanuel-Emeric=20Andra=C5=9Fi?= Date: Sun, 15 Apr 2012 12:47:43 +0200 Subject: Romanian language update --- inc/lang/ro/lang.php | 9 +++++++++ inc/lang/ro/resetpwd.txt | 3 +++ 2 files changed, 12 insertions(+) create mode 100644 inc/lang/ro/resetpwd.txt (limited to 'inc') diff --git a/inc/lang/ro/lang.php b/inc/lang/ro/lang.php index 21a6ecef4..41727e521 100644 --- a/inc/lang/ro/lang.php +++ b/inc/lang/ro/lang.php @@ -9,6 +9,7 @@ * @author Emanuel-Emeric Andraşi * @author Marius OLAR * @author Marius Olar + * @author Emanuel-Emeric Andrași */ $lang['encoding'] = 'utf-8'; $lang['direction'] = 'ltr'; @@ -44,6 +45,7 @@ $lang['btn_backtomedia'] = 'Înapoi la Selecţia Mediafile'; $lang['btn_subscribe'] = 'Subscrie Modificarea Paginii'; $lang['btn_profile'] = 'Actualizează Profil'; $lang['btn_reset'] = 'Resetează'; +$lang['btn_resendpwd'] = 'Setează o parolă nouă'; $lang['btn_draft'] = 'Editează schiţă'; $lang['btn_recover'] = 'Recuperează schiţă'; $lang['btn_draftdel'] = 'Şterge schiţă'; @@ -80,6 +82,7 @@ $lang['profnoempty'] = 'Nu sunt admise numele sau adresa de email neco $lang['profchanged'] = 'Profilul de utilizator a fost actualizat succes.'; $lang['pwdforget'] = 'Parola uitată? Luaţi una nouă'; $lang['resendna'] = 'Această wiki nu suportă retrimiterea parolei.'; +$lang['resendpwd'] = 'Setează o parolă nouă pentru'; $lang['resendpwdmissing'] = 'Ne pare rău, trebuie completate toate câmpurile.'; $lang['resendpwdnouser'] = 'Ne pare rău, acest utilizator nu poate fi găsit în baza de date.'; $lang['resendpwdbadauth'] = 'Ne pare rău, acest cod de autorizare nu este corect. Verificaţi dacă aţi folosit tot link-ul de confirmare.'; @@ -186,6 +189,11 @@ $lang['external_edit'] = 'editare externă'; $lang['summary'] = 'Editează sumarul'; $lang['noflash'] = 'Plugin-ul Adobe Flash Plugin este necesar pentru afişarea corectă a conţinutului.'; $lang['download'] = 'Bloc descărcări'; +$lang['tools'] = 'Unelte'; +$lang['user_tools'] = 'Unelte utilizator'; +$lang['site_tools'] = 'Unelte Site'; +$lang['page_tools'] = 'Unelte Pagină'; +$lang['skip_to_content'] = 'sari la conținut'; $lang['mail_newpage'] = 'pagina adăugată:'; $lang['mail_changed'] = 'page schimbată:'; $lang['mail_subscribe_list'] = 'pagini modificate în spaţiul de nume:'; @@ -256,6 +264,7 @@ $lang['subscr_style_digest'] = 'digerează email la schimbări pentru fiecare $lang['subscr_style_list'] = 'lista paginilor schimbate de la ultimul email (la fiecare %.2f zile)'; $lang['authmodfailed'] = 'Configuraţia autentificării utilizatorului este eronată. Anunţaţi Wiki Admin-ul.'; $lang['authtempfail'] = 'Autentificarea utilizatorului este temporar indisponibilă. Anunţaţi Wiki Admin-ul.'; +$lang['authpwdexpire'] = 'Parola vă va expira în %d zile, ar trebui să o schimbați curând.'; $lang['i_chooselang'] = 'Alegeţi limba'; $lang['i_installer'] = 'DokuWiki Installer'; $lang['i_wikiname'] = 'Numele Wiki'; diff --git a/inc/lang/ro/resetpwd.txt b/inc/lang/ro/resetpwd.txt new file mode 100644 index 000000000..2eb8052f1 --- /dev/null +++ b/inc/lang/ro/resetpwd.txt @@ -0,0 +1,3 @@ +====== Setează parolă nouă ====== + +Vă rugăm să introduceți o nouă parolă pentru contul dvs. pe acest wiki. \ No newline at end of file -- cgit v1.2.3 From 3ab58ffe5551d68e5a34f8e29e55c5e0c2511570 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Tue, 17 Apr 2012 09:46:23 +0200 Subject: no need to pass objects by reference fixes passing null to event hook registration --- inc/events.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'inc') diff --git a/inc/events.php b/inc/events.php index 621cb64c1..09f3f3c0c 100644 --- a/inc/events.php +++ b/inc/events.php @@ -149,8 +149,8 @@ class Doku_Event_Handler { * @param $method (function) event handler function * @param $param (mixed) data passed to the event handler */ - function register_hook($event, $advise, &$obj, $method, $param=null) { - $this->_hooks[$event.'_'.$advise][] = array(&$obj, $method, $param); + function register_hook($event, $advise, $obj, $method, $param=null) { + $this->_hooks[$event.'_'.$advise][] = array($obj, $method, $param); } function process_event(&$event,$advise='') { -- cgit v1.2.3 From 23725b9188f335447080ba9cc8e1f32cdec2e472 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Tue, 17 Apr 2012 12:15:48 +0200 Subject: have a default plugin config This allows us to distribute plugins that are disabled by default. We'll may want to do that for a special unit test plugin --- inc/config_cascade.php | 1 + 1 file changed, 1 insertion(+) (limited to 'inc') diff --git a/inc/config_cascade.php b/inc/config_cascade.php index 79567fc56..e4a3df353 100644 --- a/inc/config_cascade.php +++ b/inc/config_cascade.php @@ -66,6 +66,7 @@ $config_cascade = array_merge( ), 'plugins' => array( + 'default' => array(DOKU_CONF.'plugins.php'), 'local' => array(DOKU_CONF.'plugins.local.php'), 'protected' => array( DOKU_CONF.'plugins.required.php', -- cgit v1.2.3 From 8a803cae76e430dc0f358986db3420ef45049370 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 20 Apr 2012 21:42:53 +0200 Subject: some edge case checking in search result highlighting --- inc/fulltext.php | 2 ++ inc/html.php | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'inc') diff --git a/inc/fulltext.php b/inc/fulltext.php index 620237296..8f4db111d 100644 --- a/inc/fulltext.php +++ b/inc/fulltext.php @@ -405,6 +405,8 @@ function ft_snippet_re_preprocess($term) { }else{ $term = $term.'\b'; } + + if($term == '\b' || $term == '\b\b') $term = ''; return $term; } diff --git a/inc/html.php b/inc/html.php index 022cd792a..be5666353 100644 --- a/inc/html.php +++ b/inc/html.php @@ -280,8 +280,11 @@ function html_draft(){ * @author Harry Fuecks */ function html_hilight($html,$phrases){ - $phrases = array_filter((array) $phrases); - $regex = join('|',array_map('ft_snippet_re_preprocess', array_map('preg_quote_cb',$phrases))); + $phrases = (array) $phrases; + $phrases = array_map('preg_quote_cb', $phrases); + $phrases = array_map('ft_snippet_re_preprocess', $phrases); + $phrases = array_filter($phrases); + $regex = join('|',$phrases); if ($regex === '') return $html; if (!utf8_check($regex)) return $html; -- cgit v1.2.3 From 22ef1e32c51ac82df8d6a03e1e95876100e8f6c1 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Mon, 23 Apr 2012 12:24:08 +0200 Subject: added option to disable reverse DNS lookups --- inc/common.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'inc') diff --git a/inc/common.php b/inc/common.php index 22a315901..6ea536c44 100644 --- a/inc/common.php +++ b/inc/common.php @@ -676,10 +676,15 @@ function clientismobile(){ /** * Convert one or more comma separated IPs to hostnames * + * If $conf['dnslookups'] is disabled it simply returns the input string + * * @author Glen Harris * @returns a comma separated list of hostnames */ function gethostsbyaddrs($ips){ + global $conf; + if(!$conf['dnslookups']) return $ips; + $hosts = array(); $ips = explode(',',$ips); -- cgit v1.2.3 From f940e4a0129ffeefd746c0ebdb25132413e388c0 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Mon, 23 Apr 2012 13:23:20 +0200 Subject: display uploadable file size in media manager FS#2425 --- inc/lang/en/lang.php | 1 + inc/media.php | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) (limited to 'inc') diff --git a/inc/lang/en/lang.php b/inc/lang/en/lang.php index 2ba220e64..c1fc543fb 100644 --- a/inc/lang/en/lang.php +++ b/inc/lang/en/lang.php @@ -99,6 +99,7 @@ $lang['searchmedia_in'] = 'Search in %s'; $lang['txt_upload'] = 'Select file to upload'; $lang['txt_filename'] = 'Upload as (optional)'; $lang['txt_overwrt'] = 'Overwrite existing file'; +$lang['maxuploadsize'] = 'Upload max. %s per file.'; $lang['lockedby'] = 'Currently locked by'; $lang['lockexpire'] = 'Lock expires at'; diff --git a/inc/media.php b/inc/media.php index 66984e957..841a5218e 100644 --- a/inc/media.php +++ b/inc/media.php @@ -1602,7 +1602,35 @@ function media_uploadform($ns, $auth, $fullscreen = false){ echo NL.'
'.NL; html_form('upload', $form); + echo '
'.NL; + + echo '

'; + printf($lang['maxuploadsize'],filesize_h(media_getuploadsize())); + echo '

'.NL; + +} + +/** + * Returns the size uploaded files may have + * + * This uses a conservative approach using the lowest number found + * in any of the limiting ini settings + * + * @returns int size in bytes + */ +function media_getuploadsize(){ + $okay = 0; + + $post = (int) php_to_byte(@ini_get('post_max_size')); + $suho = (int) php_to_byte(@ini_get('suhosin.post.max_value_length')); + $upld = (int) php_to_byte(@ini_get('upload_max_filesize')); + + if($post && ($post < $okay || $okay == 0)) $okay = $post; + if($suho && ($suho < $okay || $okay == 0)) $okay = $suho; + if($upld && ($upld < $okay || $okay == 0)) $okay = $upld; + + return $okay; } /** -- cgit v1.2.3 From a1d9de52cdffcc3eec070a7089786a3ed90fdc17 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Thu, 26 Apr 2012 08:19:15 +0200 Subject: make HTTPClient loadable via autoloader this fixes the HTTP tests which do test the base class directly instead of the DokuHTTPClient subclass --- inc/load.php | 1 + 1 file changed, 1 insertion(+) (limited to 'inc') diff --git a/inc/load.php b/inc/load.php index 0572b5760..9f54034a3 100644 --- a/inc/load.php +++ b/inc/load.php @@ -49,6 +49,7 @@ function load_autoload($name){ static $classes = null; if(is_null($classes)) $classes = array( 'DokuHTTPClient' => DOKU_INC.'inc/HTTPClient.php', + 'HTTPClient' => DOKU_INC.'inc/HTTPClient.php', 'JSON' => DOKU_INC.'inc/JSON.php', 'adLDAP' => DOKU_INC.'inc/adLDAP.php', 'Diff' => DOKU_INC.'inc/DifferenceEngine.php', -- cgit v1.2.3 From 14704953412e3710917a7595b4d1e9e6d0f6e7fe Mon Sep 17 00:00:00 2001 From: Yannick Aure Date: Fri, 27 Apr 2012 15:14:54 +0200 Subject: French language update --- inc/lang/fr/lang.php | 9 +++++++++ inc/lang/fr/resetpwd.txt | 3 +++ 2 files changed, 12 insertions(+) create mode 100644 inc/lang/fr/resetpwd.txt (limited to 'inc') diff --git a/inc/lang/fr/lang.php b/inc/lang/fr/lang.php index 140c584c3..a77be6965 100644 --- a/inc/lang/fr/lang.php +++ b/inc/lang/fr/lang.php @@ -23,6 +23,7 @@ * @author Johan Guilbaud * @author schplurtz@laposte.net * @author skimpax@gmail.com + * @author Yannick Aure */ $lang['encoding'] = 'utf-8'; $lang['direction'] = 'ltr'; @@ -58,6 +59,7 @@ $lang['btn_backtomedia'] = 'Retour à la sélection du fichier média'; $lang['btn_subscribe'] = 'S\'abonner à la page'; $lang['btn_profile'] = 'Mettre à jour le profil'; $lang['btn_reset'] = 'Réinitialiser'; +$lang['btn_resendpwd'] = 'Définir un nouveau mot de passe'; $lang['btn_draft'] = 'Modifier le brouillon'; $lang['btn_recover'] = 'Récupérer le brouillon'; $lang['btn_draftdel'] = 'Effacer le brouillon'; @@ -94,6 +96,7 @@ $lang['profnoempty'] = 'Un nom ou une adresse de courriel vide n\'est $lang['profchanged'] = 'Mise à jour du profil réussie.'; $lang['pwdforget'] = 'Mot de passe oublié ? Faites-vous envoyer votre mot de passe '; $lang['resendna'] = 'Ce wiki ne permet pas le renvoi de mot de passe.'; +$lang['resendpwd'] = 'Définir un nouveau mot de passe pour'; $lang['resendpwdmissing'] = 'Désolé, vous devez remplir tous les champs.'; $lang['resendpwdnouser'] = 'Désolé, cet utilisateur est introuvable dans notre base.'; $lang['resendpwdbadauth'] = 'Désolé, ce code d\'authentification est invalide. Assurez-vous d\'avoir utilisé le lien de confirmation.'; @@ -198,6 +201,11 @@ $lang['external_edit'] = 'modification externe'; $lang['summary'] = 'Résumé'; $lang['noflash'] = 'Le greffon Adobe Flash est nécessaire pour afficher ce contenu.'; $lang['download'] = 'Télécharger un extrait'; +$lang['tools'] = 'Outils'; +$lang['user_tools'] = 'Outils d\'utilisateurs'; +$lang['site_tools'] = 'Outils du Site'; +$lang['page_tools'] = 'Outils de la Page'; +$lang['skip_to_content'] = 'Aller au contenu'; $lang['mail_newpage'] = 'page ajoutée :'; $lang['mail_changed'] = 'page modifiée :'; $lang['mail_subscribe_list'] = 'pages modifiées dans la catégorie :'; @@ -268,6 +276,7 @@ $lang['subscr_style_digest'] = 'Courriel, tous les %.2f jours, résumant les m $lang['subscr_style_list'] = 'Liste des pages modifiées depuis le dernier courriel (tous les %.2f jours)'; $lang['authmodfailed'] = 'Mauvais paramétrage de l\'authentification. Merci d\'informer l\'administrateur du Wiki.'; $lang['authtempfail'] = 'L\'authentification est temporairement indisponible. Si cela perdure, merci d\'informer l\'administrateur du Wiki.'; +$lang['authpwdexpire'] = 'Votre mot de passe expirera dans %d jours, vous devriez le changer bientôt.'; $lang['i_chooselang'] = 'Choisissez votre langue'; $lang['i_installer'] = 'Installeur DokuWiki'; $lang['i_wikiname'] = 'Nom du wiki'; diff --git a/inc/lang/fr/resetpwd.txt b/inc/lang/fr/resetpwd.txt new file mode 100644 index 000000000..7b1990ca0 --- /dev/null +++ b/inc/lang/fr/resetpwd.txt @@ -0,0 +1,3 @@ +====== Définir un nouveau mot de passe ====== + +Merci d'entrer un nouveau mot de passe pour votre compte sur ce wiki. \ No newline at end of file -- cgit v1.2.3 From 98fb3f18ab505241d412ef4892e24c97b73efcd5 Mon Sep 17 00:00:00 2001 From: Osaka Date: Fri, 27 Apr 2012 15:16:01 +0200 Subject: Japanese language update --- inc/lang/ja/lang.php | 1 + 1 file changed, 1 insertion(+) (limited to 'inc') diff --git a/inc/lang/ja/lang.php b/inc/lang/ja/lang.php index 057fa5a54..490c84cc9 100644 --- a/inc/lang/ja/lang.php +++ b/inc/lang/ja/lang.php @@ -261,6 +261,7 @@ $lang['subscr_style_digest'] = 'それぞれのページへの変更の要約 $lang['subscr_style_list'] = '前回のメールから変更されたページをリスト(%.2f 日毎)'; $lang['authmodfailed'] = 'ユーザー認証の設定が正しくありません。Wikiの管理者に連絡して下さい。'; $lang['authtempfail'] = 'ユーザー認証が一時的に使用できなくなっています。この状態が続いているようであれば、Wikiの管理者に連絡して下さい。'; +$lang['authpwdexpire'] = 'あなたのパスワードは、あと%d日で有効期限が切れます。パスワードを変更してください。'; $lang['i_chooselang'] = '使用言語を選択してください'; $lang['i_installer'] = 'DokuWiki インストーラー'; $lang['i_wikiname'] = 'Wiki名'; -- cgit v1.2.3 From bdc67fe7b11d95a896a62142b9cf675bd5e51d94 Mon Sep 17 00:00:00 2001 From: Robert Bogenschneider Date: Fri, 27 Apr 2012 15:18:35 +0200 Subject: Esperanto language update --- inc/lang/eo/conflict.txt | 4 +-- inc/lang/eo/denied.txt | 2 +- inc/lang/eo/diff.txt | 2 +- inc/lang/eo/draft.txt | 4 +-- inc/lang/eo/edit.txt | 2 +- inc/lang/eo/editrev.txt | 2 +- inc/lang/eo/index.txt | 2 +- inc/lang/eo/install.html | 12 ++++---- inc/lang/eo/lang.php | 69 ++++++++++++++++++++++++------------------- inc/lang/eo/locked.txt | 2 +- inc/lang/eo/mailtext.txt | 7 ++--- inc/lang/eo/newpage.txt | 2 +- inc/lang/eo/norev.txt | 2 +- inc/lang/eo/password.txt | 7 ++--- inc/lang/eo/preview.txt | 2 +- inc/lang/eo/pwconfirm.txt | 9 +++--- inc/lang/eo/read.txt | 2 +- inc/lang/eo/recent.txt | 2 +- inc/lang/eo/register.txt | 2 +- inc/lang/eo/registermail.txt | 5 ++-- inc/lang/eo/resendpwd.txt | 2 +- inc/lang/eo/showrev.txt | 2 +- inc/lang/eo/stopwords.txt | 4 +-- inc/lang/eo/subscr_digest.txt | 3 +- inc/lang/eo/subscr_list.txt | 3 +- inc/lang/eo/subscr_single.txt | 3 +- inc/lang/eo/updateprofile.txt | 2 +- inc/lang/eo/uploadmail.txt | 5 ++-- 28 files changed, 82 insertions(+), 83 deletions(-) (limited to 'inc') diff --git a/inc/lang/eo/conflict.txt b/inc/lang/eo/conflict.txt index 603af39e1..cd0192942 100644 --- a/inc/lang/eo/conflict.txt +++ b/inc/lang/eo/conflict.txt @@ -1,5 +1,5 @@ ====== Pli nova versio ekzistas ====== -Ekzistas pli nova versio de la dokumento. Tio okazas kiam iu alia uzanto ŝanĝigis enhavon de la dokumento dum vi redaktis ĝin. +Ekzistas pli nova versio de la dokumento. Tio okazas kiam iu alia uzanto ŝanĝis enhavon de la dokumento dum vi redaktis ĝin. -Atente esploru distingojn kaj decidu kiun version vi tenigos. Se vi premos '"Konservi'", do via versio estos konservita. Presonte butonon '"Rezigni" vi tenos la kurantan version. +Atente esploru distingojn kaj decidu kiun version vi tenos. Se vi premos '"Konservi'", do via versio estos konservita. Presonte butonon '"Rezigni" vi tenos la kurantan version. diff --git a/inc/lang/eo/denied.txt b/inc/lang/eo/denied.txt index b35fe0412..3cd6c76bf 100644 --- a/inc/lang/eo/denied.txt +++ b/inc/lang/eo/denied.txt @@ -1,4 +1,4 @@ ====== Aliro malpermesita ====== -Vi ne havas sufiĉe da rajtoj por rigardi ĉi tiujn paĝojn. Eble vi forgesis identiĝi. +Vi ne havas sufiĉajn rajtojn rigardi ĉi tiujn paĝojn. Eble vi forgesis identiĝi. diff --git a/inc/lang/eo/diff.txt b/inc/lang/eo/diff.txt index ac5474ef1..5829a7db1 100644 --- a/inc/lang/eo/diff.txt +++ b/inc/lang/eo/diff.txt @@ -1,4 +1,4 @@ ====== Diferencoj ====== -Ĉi tie vi povas ekvidi diferencojn inter la aktuala versio kaj la elektita revizio de la paĝo. +Ĉi tie vi povas vidi diferencojn inter la aktuala versio kaj la elektita revizio de la paĝo. diff --git a/inc/lang/eo/draft.txt b/inc/lang/eo/draft.txt index fa43ecb74..32ddc83f6 100644 --- a/inc/lang/eo/draft.txt +++ b/inc/lang/eo/draft.txt @@ -1,5 +1,5 @@ -====== Skiza dosiero estis trovata ====== +====== Skiza dosiero troviĝis ====== -Via lasta sekcio de redakto en tiu ĉi paĝo ne estis korekte kompletita. DokuWiki aŭtomate konservis skizon dum vi laboris, kiun vi nun povas uzi por daŭrigi vian redaktadon. Sube vi povas vidi la datenaron, kiu estis konservata el via lasta sekcio. +Via lasta sekcio de redakto en tiu ĉi paĝo ne korekte kompletiĝis. DokuWiki aŭtomate konservis skizon dum vi laboris, kiun vi nun povas uzi por daŭrigi vian redaktadon. Sube vi povas vidi la datumaron, kiu konserviĝis el via lasta sekcio. Bonvolu decidi ĉu vi volas //restarigi// vian perditan redakton, //forigi// la aŭtomate konservitan skizon aŭ //rezigni// pri la redakta procezo. diff --git a/inc/lang/eo/edit.txt b/inc/lang/eo/edit.txt index 9239c7fe6..29b3382c5 100644 --- a/inc/lang/eo/edit.txt +++ b/inc/lang/eo/edit.txt @@ -1 +1 @@ -Redaktu paĝon kaj poste premu butonon titolitan '"Konservi'". Bonvolu tralegi la [[vikio:sintakso|vikian sintakson]] por kompreni kiel vi povas krei paĝojn. Bonvolu redakti nur se vi planas **plibonigi** la enhavon de la paĝo. Se vi volas nur testi ion, do bonvolu uzi specialan paĝon: [[vikio:ludejo|ludejo]]. +Redaktu paĝon kaj poste premu butonon titolitan '"Konservi'". Bonvolu tralegi la [[wiki:syntax|vikian sintakson]] por kompreni kiel vi povas krei paĝojn. Bonvolu redakti nur se vi planas **plibonigi** la enhavon de la paĝo. Se vi volas nur testi ion, bonvolu uzi specialan paĝon: [[wiki:playground|ludejo]]. diff --git a/inc/lang/eo/editrev.txt b/inc/lang/eo/editrev.txt index 4bab50b93..1640baa91 100644 --- a/inc/lang/eo/editrev.txt +++ b/inc/lang/eo/editrev.txt @@ -1,2 +1,2 @@ -**Vi laboras kun malnova revizio de la dokumento!** Se vi konservos ĝin, tiel kreiĝos nova kuranta versio kun la sama enhavo. +**Vi laboras kun malnova revizio de la dokumento!** Se vi konservos ĝin, kreiĝos nova kuranta versio kun la sama enhavo. ---- diff --git a/inc/lang/eo/index.txt b/inc/lang/eo/index.txt index 4ef720cb2..ac1f32cba 100644 --- a/inc/lang/eo/index.txt +++ b/inc/lang/eo/index.txt @@ -1,3 +1,3 @@ ====== Enhavo ====== -Tio ĉi estas indekso pri ĉiuj disponeblaj paĝoj ordigitaj laŭ [[doku>namespaces|nomspacoj]]. \ No newline at end of file +Tio ĉi estas indekso pri ĉiuj disponeblaj paĝoj ordigitaj laŭ [[doku>namespaces|nomspacoj]]. diff --git a/inc/lang/eo/install.html b/inc/lang/eo/install.html index 9f43ae82e..2e741e7c2 100644 --- a/inc/lang/eo/install.html +++ b/inc/lang/eo/install.html @@ -1,9 +1,9 @@ -<p>Tiu ĉi paĝo helpas en la unua instalo kaj agordado de <a href="http://dokuwiki.org">DokuWiki</a>. Pli da informo pri tiu instalilo estas disponebla en ĝia propra <a href="http://dokuwiki.org/installer">dokumentada paĝo</a>.</p> +

Tiu ĉi paĝo helpas en la unua instalo kaj agordado de DokuWiki. Pli da informo pri tiu instalilo disponeblas en ĝia propra dokumentada paĝo.

-<p>DokuWiki uzas ordinarajn dosierojn por konservi vikiajn paĝojn kaj aliajn informojn asociitaj al tiuj paĝoj (ekz. bildoj, serĉindeksoj, malnovaj revizioj, ktp). Por bone funkcii, DokuWiki <strong>devas</strong> havi registran rajton sur la subdosierujoj, kiuj entenas tiujn dosierojn. Tiu ĉi instalilo ne kapablas difini permes-atributojn de dosierujoj. Ordinare, tio devas esti senpere farita de iu komando en konzolo aŭ, se vi abonas retprovizanton, per FTP aŭ kontrola panelo de tiu retprovidanto (ekz. cPanel).

+

DokuWiki uzas ordinarajn dosierojn por konservi vikiajn paĝojn kaj aliajn informojn asociitaj al tiuj paĝoj (ekz. bildoj, serĉindeksoj, malnovaj revizioj, ktp). Por bone funkcii, DokuWiki devas havi registran rajton sur la subdosierujoj, kiuj entenas tiujn dosierojn. Tiu ĉi instalilo ne kapablas difini permes-atributojn de dosierujoj. Ordinare, tio devas esti senpere farita de iu komando en konzolo aŭ, se vi abonas retprovizanton, per FTP aŭ kontrola panelo de tiu retprovidanto (ekz. cPanel).

-<p>Tiu ĉi instalilo difinos vian DokuWiki-an agordadon por <acronym title="alir-kontrola listo">ACL</acronym>, kiu ebligas al administranto identiĝi kaj aliri taŭgan interfacon por instali kromaĵojn, administri uzantojn kaj alireblon al vikipaĝoj, kaj difini agordojn ĝeneralajn. -Ĝi ne estas nepra por ke DokuWiki funkciu, tamen ĝi multe faciligos administradon.</p> +

Tiu ĉi instalilo difinos vian DokuWiki-an agordadon por ACL, kiu ebligas al administranto identiĝi kaj aliri taŭgan interfacon por instali kromaĵojn, administri uzantojn kaj alireblon al vikipaĝoj, kaj difini agordojn ĝeneralajn. +Ĝi ne estas nepra por ke DokuWiki funkciu, tamen ĝi multe faciligos administradon.

-<p>Spertuloj aŭ uzantoj kiuj bezonas specialajn agordrimedojn devus uzi tiujn ligilojn por havi pli detalojn pri <a href="http://dokuwiki.org/install">instaladaj instrukcioj</a> -kaj <a href="http://dokuwiki.org/config">agordadaj difinoj</a>.</p> \ No newline at end of file +

Spertuloj aŭ uzantoj kiuj bezonas specialajn agordrimedojn uzu tiujn ligilojn por havi pli detalojn pri instaladaj instrukcioj +kaj agordadaj difinoj.

diff --git a/inc/lang/eo/lang.php b/inc/lang/eo/lang.php index 41c6b80d1..b2c64b2a6 100644 --- a/inc/lang/eo/lang.php +++ b/inc/lang/eo/lang.php @@ -9,7 +9,7 @@ * @author Felipe Castro * @author Robert Bogenschneider * @author Erik Pedersen - * @author Robert BOGENSCHNEIDER + * @author Robert Bogenschneider */ $lang['encoding'] = 'utf-8'; $lang['direction'] = 'ltr'; @@ -45,6 +45,7 @@ $lang['btn_backtomedia'] = 'Retroiri al elekto de dosiero'; $lang['btn_subscribe'] = 'Aliĝi al paĝaj modifoj'; $lang['btn_profile'] = 'Ĝisdatigi profilon'; $lang['btn_reset'] = 'Rekomenci'; +$lang['btn_resendpwd'] = 'Sendi novan pasvorton'; $lang['btn_draft'] = 'Redakti skizon'; $lang['btn_recover'] = 'Restarigi skizon'; $lang['btn_draftdel'] = 'Forigi skizon'; @@ -68,38 +69,39 @@ $lang['draftdate'] = 'Lasta konservo de la skizo:'; $lang['nosecedit'] = 'La paĝo ŝanĝiĝis intertempe, sekcio-informo estis malĝisdata, tial la tuta paĝo estas reŝargita.'; $lang['regmissing'] = 'Pardonu, vi devas plenigi ĉiujn kampojn.'; $lang['reguexists'] = 'Pardonu, ĉi tiu uzanto-nomo jam ekzistas.'; -$lang['regsuccess'] = 'La uzanto estas kreita kaj la pasvorto estis elsendita per retpoŝto.'; -$lang['regsuccess2'] = 'La uzanto estas kreita.'; +$lang['regsuccess'] = 'La uzanto kreiĝis kaj la pasvorto sendiĝis per retpoŝto.'; +$lang['regsuccess2'] = 'La uzanto kreiĝis.'; $lang['regmailfail'] = 'Ŝajne okazis eraro dum elsendo de la pasvorto. Bonvolu informi administranton pri tio!'; -$lang['regbadmail'] = 'Entajpita retpoŝta adreso ne ŝajnas valida. Se vi pensas, ke tio estas eraro, kontaktu la administranton.'; +$lang['regbadmail'] = 'Entajpita retpoŝta adreso ŝajnas ne valida. Se vi pensas, ke tio estas eraro, kontaktu la administranton.'; $lang['regbadpass'] = 'La du pasvortoj ne samas, bonvolu provi refoje.'; $lang['regpwmail'] = 'Via DokuWiki-pasvorto'; $lang['reghere'] = 'Se vi ne havas konton, vi povas akiri ĝin'; $lang['profna'] = 'Tiu ĉi vikio ne ebligas modifon en la profiloj.'; $lang['profnochange'] = 'Neniu ŝanĝo, nenio farinda.'; -$lang['profnoempty'] = 'Malplena nomo aŭ retadreso ne estas permesataj.'; -$lang['profchanged'] = 'La profilo de la uzanto estas sukcese ĝisdatigita.'; +$lang['profnoempty'] = 'Malplena nomo aŭ retadreso ne estas permesata.'; +$lang['profchanged'] = 'La profilo de la uzanto sukcese ĝisdatiĝis.'; $lang['pwdforget'] = 'Ĉu vi forgesis vian pasvorton? Prenu novan'; $lang['resendna'] = 'Tiu ĉi vikio ne ebligas resendon de la pasvortoj.'; +$lang['resendpwd'] = 'Sendi novan pasvorton al'; $lang['resendpwdmissing'] = 'Pardonu, vi devas plenigi ĉiujn kampojn.'; -$lang['resendpwdnouser'] = 'Pardonu, ni ne trovas tiun uzanton en nia datenbazo.'; +$lang['resendpwdnouser'] = 'Pardonu, tiu uzanto ne troveblas en nia datumbazo.'; $lang['resendpwdbadauth'] = 'Pardonu, tiu aŭtentiga kodo ne validas. Certiĝu, ke vi uzis la kompletan konfirmigan ligilon.'; -$lang['resendpwdconfirm'] = 'Konfirmiga ligilo estas sendita per retpoŝto.'; -$lang['resendpwdsuccess'] = 'Via nova pasvorto estas sendita per retpoŝto.'; +$lang['resendpwdconfirm'] = 'Konfirmiga ligilo sendiĝis per retpoŝto.'; +$lang['resendpwdsuccess'] = 'Via nova pasvorto sendiĝis per retpoŝto.'; $lang['license'] = 'Krom kie rekte indikite, enhavo de tiu ĉi vikio estas publikigita laŭ la jena permesilo:'; $lang['licenseok'] = 'Rimarku: redaktante tiun ĉi paĝon vi konsentas publikigi vian enhavon laŭ la jena permesilo:'; $lang['searchmedia'] = 'Serĉi dosiernomon:'; $lang['searchmedia_in'] = 'Serĉi en %s'; -$lang['txt_upload'] = 'Elektu dosieron por alŝuto'; +$lang['txt_upload'] = 'Elektu dosieron por alŝuti'; $lang['txt_filename'] = 'Alŝuti kiel (laŭvole)'; $lang['txt_overwrt'] = 'Anstataŭigi ekzistantan dosieron'; $lang['lockedby'] = 'Nune ŝlosita de'; $lang['lockexpire'] = 'Ŝlosado ĉesos en'; -$lang['js']['willexpire'] = 'Vi povos redakti ĉi tiun paĝon post unu minuto.\nSe vi volas nuligi tempkontrolon de la ŝlosado, do premu butonon "Antaŭrigardi".'; +$lang['js']['willexpire'] = 'Vi povos redakti ĉi tiun paĝon post unu minuto.\nSe vi volas nuligi tempokontrolon de la ŝlosado, premu la butonon "Antaŭrigardi".'; $lang['js']['notsavedyet'] = 'Ne konservitaj modifoj perdiĝos. Ĉu vi certe volas daŭrigi la procezon?'; $lang['js']['searchmedia'] = 'Serĉi dosierojn'; -$lang['js']['keepopen'] = 'Tenu la fenestron malfermata dum elekto'; +$lang['js']['keepopen'] = 'Tenu la fenestron malferma dum elekto'; $lang['js']['hidedetails'] = 'Kaŝi detalojn'; $lang['js']['mediatitle'] = 'Ligilaj agordoj'; $lang['js']['mediadisplay'] = 'Ligila tipo'; @@ -122,10 +124,10 @@ $lang['js']['medialeft'] = 'Meti la bildon maldekstren.'; $lang['js']['mediaright'] = 'Meti la bildon dekstren.'; $lang['js']['mediacenter'] = 'Meti la bildon mezen.'; $lang['js']['medianoalign'] = 'Ne uzi poziciigon.'; -$lang['js']['nosmblinks'] = 'Tio ĉi nur funkcias en la Vindozaĉa "Microsoft Internet Explorer".\nVi ankoraŭ povas kopii kaj almeti la ligilon.'; +$lang['js']['nosmblinks'] = 'Tio ĉi nur funkcias en "Microsoft Internet Explorer".\nVi ankoraŭ povas kopii kaj almeti la ligilon.'; $lang['js']['linkwiz'] = 'Ligil-Asistanto'; $lang['js']['linkto'] = 'Ligilo al:'; -$lang['js']['del_confirm'] = 'Ĉu vere forigi elektitajn ero(j)n?'; +$lang['js']['del_confirm'] = 'Ĉu vere forigi elektita(j)n ero(j)n?'; $lang['js']['restore_confirm'] = 'Ĉu vere restarigi ĉi tiun version?'; $lang['js']['media_diff'] = 'Rigardu la diferencojn:'; $lang['js']['media_diff_both'] = 'Flankon apud flanko'; @@ -141,27 +143,27 @@ $lang['rssfailed'] = 'Okazis eraro dum ricevado de la novaĵ-fluo: ' $lang['nothingfound'] = 'Ankoraŭ nenio troviĝas tie ĉi.'; $lang['mediaselect'] = 'Elekto de aŭdvidaĵa dosiero'; $lang['fileupload'] = 'Alŝuto de aŭdvidaĵa dosiero'; -$lang['uploadsucc'] = 'Alŝuto estis sukcesa'; -$lang['uploadfail'] = 'Alŝuto estis malsukcesa. Eble ĉu estas problemoj pro permes-atributoj?'; +$lang['uploadsucc'] = 'Alŝuto sukcesis'; +$lang['uploadfail'] = 'Alŝuto malsukcesis. Ĉu eble estas problemoj pro permes-atributoj?'; $lang['uploadwrong'] = 'Rifuzita alŝuto. Tiu ĉi dosiersufikso estas malpermesata!'; $lang['uploadexist'] = 'La dosiero jam ekzistas. Nenio estas farita.'; $lang['uploadbadcontent'] = 'La alŝutita enhavo ne kongruas al la sufikso %s.'; -$lang['uploadspam'] = 'La alŝutaĵo estis blokita de kontraŭspama vortlisto.'; -$lang['uploadxss'] = 'La alŝutajo estis blokita pro ebla malica enhavo.'; +$lang['uploadspam'] = 'La alŝutaĵo blokiĝis de kontraŭspama vortlisto.'; +$lang['uploadxss'] = 'La alŝutajo blokiĝis pro ebla malica enhavo.'; $lang['uploadsize'] = 'La alŝutita dosiero estis tro granda. (maks. %s)'; -$lang['deletesucc'] = 'La dosiero "%s" estas forigita.'; +$lang['deletesucc'] = 'La dosiero "%s" forigiĝis.'; $lang['deletefail'] = '"%s" ne povis esti forigita - kontrolu permes-atributojn.'; -$lang['mediainuse'] = 'La dosiero "%s" ne estis forigita - ĝi ankoraŭ estas uzata.'; +$lang['mediainuse'] = 'La dosiero "%s" ne forigiĝis - ĝi ankoraŭ estas uzata.'; $lang['namespaces'] = 'Nomspacoj'; $lang['mediafiles'] = 'Disponeblaj dosieroj'; $lang['accessdenied'] = 'Vi ne rajtas vidi tiun paĝon.'; -$lang['mediausage'] = 'Uzu la jenan sintakson por referenci tiun ĉi dosieron:'; +$lang['mediausage'] = 'Uzu jenan sintakson por referenci tiun ĉi dosieron:'; $lang['mediaview'] = 'Rigardi originalan dosieron'; $lang['mediaroot'] = 'ĉefo (root)'; -$lang['mediaupload'] = 'Alŝutu dosieron al la kuranta nomspaco tien ĉi. Por krei subnomspacojn, antaŭmetu ilin al via "Alŝuti kiel" dosiernomo, apartigante per dupunktoj (:).'; +$lang['mediaupload'] = 'Alŝutu dosieron al la kuranta nomspaco tien ĉi. Por krei subnomspacojn, antaŭmetu ilin al via "Alŝuti kiel" dosiernomo, disigigante per dupunktoj (:).'; $lang['mediaextchange'] = 'La dosiersufikso ŝanĝis de .%s al .%s!'; $lang['reference'] = 'Referencoj por'; -$lang['ref_inuse'] = 'La dosiero ne povas esti forigita, ĉar ĝi ankoraŭ estas uzata de la jenaj paĝoj:'; +$lang['ref_inuse'] = 'La dosiero ne povas esti forigita, ĉar ĝi ankoraŭ estas uzata de jenaj paĝoj:'; $lang['ref_hidden'] = 'Kelkaj referencoj estas en paĝoj, kiujn vi ne rajtas legi'; $lang['hits'] = 'Trafoj'; $lang['quickhits'] = 'Trafoj trovitaj en paĝnomoj'; @@ -184,8 +186,13 @@ $lang['created'] = 'kreita'; $lang['restored'] = 'malnova revizio restarigita'; $lang['external_edit'] = 'ekstera redakto'; $lang['summary'] = 'Bulteno de ŝanĝoj'; -$lang['noflash'] = 'La Adobe Flash Plugin estas bezonata por montrigi tiun ĉi enhavon.'; +$lang['noflash'] = 'La Adobe Flash Plugin necesas por montri tiun ĉi enhavon.'; $lang['download'] = 'Elŝuti eltiraĵon'; +$lang['tools'] = 'Iloj'; +$lang['user_tools'] = 'Uzantaj iloj'; +$lang['site_tools'] = 'Retejaj iloj'; +$lang['page_tools'] = 'Paĝaj iloj'; +$lang['skip_to_content'] = 'al la enhavo'; $lang['mail_newpage'] = 'paĝo aldonita:'; $lang['mail_changed'] = 'paĝo modifita:'; $lang['mail_subscribe_list'] = 'ŝanĝitaj paĝoj en nomspaco:'; @@ -221,10 +228,10 @@ $lang['qb_smileys'] = 'Ridetuloj'; $lang['qb_chars'] = 'Specialaj signaĵoj'; $lang['upperns'] = 'saltu al la parenca nomspaco'; $lang['admin_register'] = 'Aldoni novan uzanton'; -$lang['metaedit'] = 'Redakti metadatenaron'; -$lang['metasaveerr'] = 'La konservo de metadatenaro malsukcesis'; -$lang['metasaveok'] = 'La metadatenaro estis konservita'; -$lang['img_backto'] = 'Retroiri al'; +$lang['metaedit'] = 'Redakti metadatumaron'; +$lang['metasaveerr'] = 'La konservo de metadatumaro malsukcesis'; +$lang['metasaveok'] = 'La metadatumaro konserviĝis'; +$lang['img_backto'] = 'Iri reen al'; $lang['img_title'] = 'Titolo'; $lang['img_caption'] = 'Priskribo'; $lang['img_date'] = 'Dato'; @@ -237,7 +244,7 @@ $lang['img_camera'] = 'Kamerao'; $lang['img_keywords'] = 'Ŝlosilvortoj'; $lang['img_width'] = 'Larĝeco'; $lang['img_height'] = 'Alteco'; -$lang['img_manager'] = 'Rigardi en media-administrilo'; +$lang['img_manager'] = 'Rigardi en aŭdvidaĵ-administrilo'; $lang['subscr_subscribe_success'] = 'Aldonis %s al la abonlisto por %s'; $lang['subscr_subscribe_error'] = 'Eraro dum aldono de %s al la abonlisto por %s'; $lang['subscr_subscribe_noaddress'] = 'Ne estas adreso ligita al via ensaluto, ne eblas aldoni vin al la abonlisto'; @@ -271,7 +278,7 @@ $lang['i_confexists'] = '%s jam ekzistas'; $lang['i_writeerr'] = 'Ne eblas krei "%s". Vi bezonas kontroli la permesojn de la dosier(uj)oj kaj mem krej la dosieron.'; $lang['i_badhash'] = 'dokuwiki.php ne estas rekonebla aŭ ĝi estas modifita (hash=%s)'; $lang['i_badval'] = '%s - malvalida aŭ malplena valoro'; -$lang['i_success'] = 'La agordado estas sukcese kompletita. Vi povas forigi la dosieron nun. Pluiru al via nova DokuWiki.'; +$lang['i_success'] = 'La agordado sukcese kompletiĝis. Vi povas forigi la dosieron nun. Pluiru al via nova DokuWiki.'; $lang['i_failure'] = 'Kelkaj eraroj okazis dum la konservo de la agordaj dosieroj. Vi devas senpere korekti ilin antaŭ ol vi povos uzi vian novan DokuWiki-on. '; $lang['i_policy'] = 'Komenca ACL-a agordo'; $lang['i_pol0'] = 'Malferma Vikio (legi, skribi, alŝuti povas ĉiuj)'; @@ -287,7 +294,7 @@ $lang['days'] = 'antaŭ %d tagoj'; $lang['hours'] = 'antaŭ %d horoj'; $lang['minutes'] = 'antaŭ %d minutoj'; $lang['seconds'] = 'antaŭ %d sekundoj'; -$lang['wordblock'] = 'Via ŝanĝo ne estis savita, ĉar ĝi enhavas blokitan tekston (spamon).'; +$lang['wordblock'] = 'Via ŝanĝo ne konserviĝis, ĉar ĝi enhavas blokitan tekston (spamon).'; $lang['media_uploadtab'] = 'Alŝuto'; $lang['media_searchtab'] = 'Serĉo'; $lang['media_file'] = 'Dosiero'; diff --git a/inc/lang/eo/locked.txt b/inc/lang/eo/locked.txt index 68963da75..abdc05916 100644 --- a/inc/lang/eo/locked.txt +++ b/inc/lang/eo/locked.txt @@ -1,3 +1,3 @@ ====== La paĝo estas ŝlosita ====== -Tiu ĉi paĝo nun estas blokita pro redaktado de iu alia uzanto. Bonvole atendu ke ŝi/li finu redakti aŭ ke la ŝlosada tempolimo finiĝu. +Tiu ĉi paĝo nun blokiĝis pro redaktado de iu alia uzanto. Bonvolu atendi ke ŝi/li finu redakti aŭ ke la ŝlosada tempolimo finiĝu. diff --git a/inc/lang/eo/mailtext.txt b/inc/lang/eo/mailtext.txt index b2cb3b49d..2765301ea 100644 --- a/inc/lang/eo/mailtext.txt +++ b/inc/lang/eo/mailtext.txt @@ -1,4 +1,4 @@ -Paĝo en via DokuVikio estis ŝanĝita aŭ aldonita. Jen detaloj: +Paĝo en via DokuVikio ŝanĝiĝis aŭ aldoniĝis. Jen detaloj: Dato: @DATE@ Foliumilo: @BROWSER@ @@ -7,10 +7,9 @@ RetNodo: @HOSTNAME@ Antaŭa revizio: @OLDPAGE@ Nova revizio: @NEWPAGE@ Bulteno de ŝanĝoj: @SUMMARY@ -Uzulo: @USER@ +Uzanto: @USER@ @DIFF@ -- -Tiu ĉi mesaĝo estis kreita de DokuWiki, kiu lokiĝas tie: -@DOKUWIKIURL@ \ No newline at end of file +Tiu ĉi mesaĝo kreiĝis de DokuWiki, kiu lokiĝas ĉe @DOKUWIKIURL@ diff --git a/inc/lang/eo/newpage.txt b/inc/lang/eo/newpage.txt index 486f61f5a..53ab6209d 100644 --- a/inc/lang/eo/newpage.txt +++ b/inc/lang/eo/newpage.txt @@ -1,4 +1,4 @@ ====== Ĉi tiu paĝo ankoraŭ ne ekzistas ====== -Vi sekvis ligilon, kiu kondukas al artikolo ankoraŭ ne ekzistanta. Se vi rajtas, tiel vi povas krei tiun ĉi paĝon ekpremante la butonon "Krei paĝon". +Vi sekvis ligilon, kiu kondukas al artikolo ankoraŭ ne ekzistanta. Se vi rajtas, tiam vi povas krei tiun ĉi paĝon premante la butonon "Krei paĝon". diff --git a/inc/lang/eo/norev.txt b/inc/lang/eo/norev.txt index dc44d194b..e951a551b 100644 --- a/inc/lang/eo/norev.txt +++ b/inc/lang/eo/norev.txt @@ -1,3 +1,3 @@ ====== Tiu revizio ne ekzistas ====== -La elektita revizio ne ekzistas. Premu butonon "Malnovaj revizioj" por vidi liston de malnovaj revizioj de la dokumento. \ No newline at end of file +La elektita revizio ne ekzistas. Premu butonon "Malnovaj revizioj" por vidi liston de malnovaj revizioj de la dokumento. diff --git a/inc/lang/eo/password.txt b/inc/lang/eo/password.txt index ef744059e..6dc42a9de 100644 --- a/inc/lang/eo/password.txt +++ b/inc/lang/eo/password.txt @@ -1,10 +1,9 @@ -Saluton @FULLNAME@! +Saluton, @FULLNAME@! -Jen via uzantodatenoj por @TITLE@ ĉe @DOKUWIKIURL@ +Jen viaj uzantodatumoj por @TITLE@ ĉe @DOKUWIKIURL@ Ensalutnomo: @LOGIN@ Pasvorto: @PASSWORD@ -- -Tiu ĉi mesaĝo estis kreita de DokuWiki ĉe -@DOKUWIKIURL@ +Tiu ĉi mesaĝo kreiĝis de DokuWiki ĉe @DOKUWIKIURL@ diff --git a/inc/lang/eo/preview.txt b/inc/lang/eo/preview.txt index ac2e75d00..b3faef69e 100644 --- a/inc/lang/eo/preview.txt +++ b/inc/lang/eo/preview.txt @@ -1,3 +1,3 @@ ====== Antaŭrigardo ====== -Tiu ĉi estas antaŭrigardo de redaktita teksto. Memoru: ĝi ankoraŭ **ne estas konservita**! \ No newline at end of file +Tiu ĉi estas antaŭrigardo de redaktita teksto. Memoru: ĝi ankoraŭ **ne konserviĝis**! diff --git a/inc/lang/eo/pwconfirm.txt b/inc/lang/eo/pwconfirm.txt index f227752b1..5abc3d13e 100644 --- a/inc/lang/eo/pwconfirm.txt +++ b/inc/lang/eo/pwconfirm.txt @@ -1,14 +1,13 @@ -Saluton @FULLNAME@! +Saluton, @FULLNAME@! Iu petis novan pasvorton por via @TITLE@ ensalutnomo ĉe @DOKUWIKIURL@ -Se ne estas vi, kiu petis tion, do preterlasu tiun ĉi mesaĝon. +Se ne vi petis tion, ignoru tiun ĉi mesaĝon. -Por konfirmi, ke la peto estis vere via, bonvolu musklaki la jenan ligilon. +Por konfirmi, ke la peto estis vere via, bonvolu musklaki jenan ligilon: @CONFIRM@ -- -Tiu ĉi mesaĝo estis kreita de DokuWiki ĉe -@DOKUWIKIURL@ \ No newline at end of file +Tiu ĉi mesaĝo kreiĝis de DokuWiki ĉe @DOKUWIKIURL@ diff --git a/inc/lang/eo/read.txt b/inc/lang/eo/read.txt index 734eb1654..b8c642f43 100644 --- a/inc/lang/eo/read.txt +++ b/inc/lang/eo/read.txt @@ -1,2 +1,2 @@ -Tiu ĉi paĝo estas disponigata nur por legado (vi ne povas redakti ĝin). Sciigu administranton, se vi opinias ke tio estas ne ĝusta malpermeso. +Tiu ĉi paĝo disponiĝas nur por legado (vi ne povas redakti ĝin). Sciigu administranton, se vi opinias ke tio estas falsa malpermeso. diff --git a/inc/lang/eo/recent.txt b/inc/lang/eo/recent.txt index ffd9936e2..2454ea630 100644 --- a/inc/lang/eo/recent.txt +++ b/inc/lang/eo/recent.txt @@ -1,3 +1,3 @@ ====== Freŝaj Ŝanĝoj ====== -La jenaj paĝoj estis ŝanĝitaj antaŭ nelonga tempo. \ No newline at end of file +Jenaj paĝoj ŝanĝiĝis antaŭ nelonge: diff --git a/inc/lang/eo/register.txt b/inc/lang/eo/register.txt index 57d5ca1f4..10b303d3b 100644 --- a/inc/lang/eo/register.txt +++ b/inc/lang/eo/register.txt @@ -1,4 +1,4 @@ ====== Registriĝi ====== -Entajpu necesajn informojn por enregistriĝi. Certiĝu ke via retpoŝta adreso estas vera ĉar ni sendos al ĝi vian pasvorton. +Entajpu necesajn informojn por enregistriĝi. Certiĝu ke via retpoŝta adreso estas vera, ĉar ni sendos al ĝi vian pasvorton. diff --git a/inc/lang/eo/registermail.txt b/inc/lang/eo/registermail.txt index 8b9ea8501..9ef6013c0 100644 --- a/inc/lang/eo/registermail.txt +++ b/inc/lang/eo/registermail.txt @@ -1,4 +1,4 @@ -Nova uzanto estis registrata. Jen la detaloj: +Nova uzanto registriĝis. Jen la detaloj: Uzantonomo: @NEWUSER@ Kompleta nomo: @NEWNAME@ @@ -10,5 +10,4 @@ IP-Adreso: @IPADDRESS@ Provizanto: @HOSTNAME@ -- -Tiu ĉi mesaĝo estis kreita de DokuWiki ĉe -@DOKUWIKIURL@ \ No newline at end of file +Tiu ĉi mesaĝo kreiĝis de DokuWiki ĉe @DOKUWIKIURL@ diff --git a/inc/lang/eo/resendpwd.txt b/inc/lang/eo/resendpwd.txt index 57b4b0408..556477a07 100644 --- a/inc/lang/eo/resendpwd.txt +++ b/inc/lang/eo/resendpwd.txt @@ -1,3 +1,3 @@ ====== Sendi novan pasvorton ====== -Bonvolu meti vian uzantonomon en la suban formularon petante novan pasvorton por via aliĝo en tiu ĉi vikio. Konfirma ligilo estos sendata al via registrita retadreso. +Bonvolu meti vian uzantonomon en la suban formularon petante novan pasvorton por via aliĝo en tiu ĉi vikio. Konfirma ligilo sendaiĝos al via registrita retadreso. diff --git a/inc/lang/eo/showrev.txt b/inc/lang/eo/showrev.txt index e3a8a1747..3ece4f2fb 100644 --- a/inc/lang/eo/showrev.txt +++ b/inc/lang/eo/showrev.txt @@ -1,2 +1,2 @@ -**Tiu estas malnova revizio de la dokumento**. Klaku sur titolo por ricevi kurantan version. +**Tiu estas malnova revizio de la dokumento**. Klaku sur titolon por ricevi kurantan version. ---- diff --git a/inc/lang/eo/stopwords.txt b/inc/lang/eo/stopwords.txt index 38757ae04..d27c569a2 100644 --- a/inc/lang/eo/stopwords.txt +++ b/inc/lang/eo/stopwords.txt @@ -1,6 +1,6 @@ # Jen listo de vortoj, kiujn la indeksilo ignoras, unu vorton po linio # Kiam vi modifas la dosieron, estu certa ke vi uzas UNIX-stilajn linifinaĵojn (unuopa novlinio) -# Ne enmetu vortojn malpli longajn ol 3 literoj - tiuj ĉiukaze estas ignorataj +# Ne enmetu vortojn malpli longajn ol 3 literoj - tiuj ĉiukaze ignoriĝas pri estas kaj @@ -17,4 +17,4 @@ kio kiam kie kiu -www \ No newline at end of file +www diff --git a/inc/lang/eo/subscr_digest.txt b/inc/lang/eo/subscr_digest.txt index d6bc69887..42fc79ad1 100644 --- a/inc/lang/eo/subscr_digest.txt +++ b/inc/lang/eo/subscr_digest.txt @@ -16,5 +16,4 @@ Por nuligi la paĝinformojn, ensalutu la vikion ĉe kaj malabonu la paĝajn kaj/aŭ nomspacajn ŝanĝojn. -- -Tiu retpoŝtaĵo kreiĝis de DokuWiki ĉe -@DOKUWIKIURL@ \ No newline at end of file +Tiu retpoŝtaĵo kreiĝis de DokuWiki ĉe @DOKUWIKIURL@ diff --git a/inc/lang/eo/subscr_list.txt b/inc/lang/eo/subscr_list.txt index 175e3f3d2..1957e85e0 100644 --- a/inc/lang/eo/subscr_list.txt +++ b/inc/lang/eo/subscr_list.txt @@ -13,5 +13,4 @@ Por nuligi la paĝinformojn, ensalutu la vikion ĉe kaj malabonu la paĝajn kaj/aŭ nomspacajn ŝanĝojn. -- -Tiu retpoŝtaĵo kreiĝis de DokuWiki ĉe -@DOKUWIKIURL@ \ No newline at end of file +Tiu retpoŝtaĵo kreiĝis de DokuWiki ĉe @DOKUWIKIURL@ diff --git a/inc/lang/eo/subscr_single.txt b/inc/lang/eo/subscr_single.txt index d51c5ca15..431fd0251 100644 --- a/inc/lang/eo/subscr_single.txt +++ b/inc/lang/eo/subscr_single.txt @@ -19,5 +19,4 @@ Por nuligi la paĝinformojn, ensalutu la vikion ĉe kaj malabonu la paĝajn kaj/aŭ nomspacajn ŝanĝojn. -- -Tiu retpoŝtaĵo kreiĝis de DokuWiki ĉe -@DOKUWIKIURL@ \ No newline at end of file +Tiu retpoŝtaĵo kreiĝis de DokuWiki ĉe @DOKUWIKIURL@ diff --git a/inc/lang/eo/updateprofile.txt b/inc/lang/eo/updateprofile.txt index a3de0c840..4b52ff20a 100644 --- a/inc/lang/eo/updateprofile.txt +++ b/inc/lang/eo/updateprofile.txt @@ -1,3 +1,3 @@ ====== Ĝisdatigi vian profilon ====== -Vi nur bezonas kompletigi tiujn kampojn, kiujn vi deziras ŝanĝi. Vi ne povas ŝanĝi vian uzantonomon. \ No newline at end of file +Vi nur kompletigu tiujn kampojn, kiujn vi deziras ŝanĝi. Vi ne povas ŝanĝi vian uzantonomon. diff --git a/inc/lang/eo/uploadmail.txt b/inc/lang/eo/uploadmail.txt index e7c327a60..1cb48ade6 100644 --- a/inc/lang/eo/uploadmail.txt +++ b/inc/lang/eo/uploadmail.txt @@ -1,4 +1,4 @@ -Dosiero estis alŝutita al via DokuVikio. Jen detaloj: +Dosiero alŝutiĝis al via DokuVikio. Jen detaloj: Dosiero: @MEDIA@ Dato: @DATE@ @@ -10,5 +10,4 @@ Dosier-tipo: @MIME@ Uzanto: @USER@ -- -Tiu ĉi mesaĝo estis kreita de DokuWiki ĉe -@DOKUWIKIURL@ \ No newline at end of file +Tiu ĉi mesaĝo kreiĝis de DokuWiki ĉe @DOKUWIKIURL@ -- cgit v1.2.3 From 22f44d031dd846cd1ff2f032ea10bc1ff1797f42 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Tue, 1 May 2012 21:18:17 +0200 Subject: avoid integer overflow in PassHash::pmd5 method Input iteration counts are squared in the function and passing something above 30 is giving integer overflows on 32 bit systems (and causes insane iteration counts on 64bit systems). --- inc/PassHash.class.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'inc') diff --git a/inc/PassHash.class.php b/inc/PassHash.class.php index 3fb1349d2..d825057f0 100644 --- a/inc/PassHash.class.php +++ b/inc/PassHash.class.php @@ -316,6 +316,11 @@ class PassHash { * Uses salted MD5 hashs. Salt is 1+8 bytes long, 1st byte is the * iteration count when given, for null salts $compute is used. * + * The actual iteration count is the given count squared, maximum is + * 30 (-> 1073741824). If a higher one is given, the function throws + * an exception. + * + * @link http://www.openwall.com/phpass/ * @param string $clear - the clear text to hash * @param string $salt - the salt to use, null for random * @param string $magic - the hash identifier (P or H) @@ -330,6 +335,12 @@ class PassHash { } $iterc = $salt[0]; // pos 0 of salt is iteration count $iter = strpos($itoa64,$iterc); + + if($iter > 30){ + throw new Exception("Too high iteration count ($iter) in ". + __class__.'::'.__function__); + } + $iter = 1 << $iter; $salt = substr($salt,1,8); -- cgit v1.2.3 From e0f1fe02c25f445ed53c695a4f61bd6ba9910fde Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Wed, 2 May 2012 23:35:14 +0200 Subject: removed duplicated documentation header in JSON.php --- inc/JSON.php | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'inc') diff --git a/inc/JSON.php b/inc/JSON.php index 2dea44003..b31340f44 100644 --- a/inc/JSON.php +++ b/inc/JSON.php @@ -47,8 +47,6 @@ * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * - * @category - * @package * @author Michal Migurski * @author Matt Knapp * @author Brett Stimmerman @@ -97,19 +95,6 @@ define('JSON_STRICT_TYPE', 11); /** * Converts to and from JSON format. - * - * @category - * @package - * @author Michal Migurski - * @author Matt Knapp - * @author Brett Stimmerman - * @copyright 2005 Michal Migurski - * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version - * @link - * @see - * @since - * @deprecated */ class JSON { -- cgit v1.2.3 From 040571dbb13c148147a105a8c0857057c358093c Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Thu, 3 May 2012 00:33:38 +0200 Subject: also skip native JSON encoding when skipnative is true --- inc/JSON.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'inc') diff --git a/inc/JSON.php b/inc/JSON.php index b31340f44..012697eb3 100644 --- a/inc/JSON.php +++ b/inc/JSON.php @@ -136,7 +136,9 @@ class JSON { * @access public */ function encode($var) { - if (function_exists('json_encode')) return json_encode($var); + if (!$this->skipnative && function_exists('json_encode')){ + return json_encode($var); + } switch (gettype($var)) { case 'boolean': return $var ? 'true' : 'false'; -- cgit v1.2.3 From 55ce110126c81c7f7c821183fab3018cacc40016 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Thu, 3 May 2012 00:34:24 +0200 Subject: fixed a JSON bug with handling backspaces This was fixed in upstream and the upstream tests caught this :-) --- inc/JSON.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'inc') diff --git a/inc/JSON.php b/inc/JSON.php index 012697eb3..7f89005ff 100644 --- a/inc/JSON.php +++ b/inc/JSON.php @@ -569,17 +569,17 @@ class JSON { } - } elseif ((($chrs{$c} == '"') || ($chrs{$c} == "'")) && - in_array($top['what'], array(JSON_SLICE, JSON_IN_ARR, JSON_IN_OBJ))) { + } elseif ((($chrs{$c} == '"') || ($chrs{$c} == "'")) && ($top['what'] != JSON_IN_STR)) { // found a quote, and we are not inside a string array_push($stk, array('what' => JSON_IN_STR, 'where' => $c, 'delim' => $chrs{$c})); //print("Found start of string at {$c}\n"); } elseif (($chrs{$c} == $top['delim']) && ($top['what'] == JSON_IN_STR) && - (($chrs{$c - 1} != "\\") || - ($chrs{$c - 1} == "\\" && $chrs{$c - 2} == "\\"))) { + ((strlen(substr($chrs, 0, $c)) - strlen(rtrim(substr($chrs, 0, $c), '\\'))) % 2 != 1)) { // found a quote, we're in a string, and it's not escaped + // we know that it's not escaped becase there is _not_ an + // odd number of backslashes at the end of the string so far array_pop($stk); //print("Found end of string at {$c}: ".substr($chrs, $top['where'], (1 + 1 + $c - $top['where']))."\n"); -- cgit v1.2.3