Commit cb812352 by Scott

Merge branch 'dev' (1.7.3) into 1.8

parents 074e21a7 768ed4d1
Options -Indexes
DirectoryIndex index.php
<IfModule mod_rewrite.c>
RewriteEngine On
......
sudo: false
language: php
php:
- 5.3
- 5.4
- 5.5
- '5.3'
- '5.4'
- '5.5'
- '5.6'
- '7.0'
notifications:
email:
......@@ -12,32 +16,16 @@ notifications:
before_script:
# PHP_CodeSniffer
- pear install pear/PHP_CodeSniffer
- phpenv rehash
- curl -o phpcs.phar https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
# PHP Copy/Paste Detector
- curl -o phpcpd.phar https://phar.phpunit.de/phpcpd.phar
# PHP Mess Detector
- pear config-set preferred_state beta
- printf "\n\n" | pecl install imagick
- pear channel-discover pear.phpmd.org
- pear channel-discover pear.pdepend.org
- pear install --alldeps phpmd/PHP_PMD
- phpenv rehash
# PHPLOC
- curl -o phploc.phar https://phar.phpunit.de/phploc-2.0.6.phar
# Basic config required for PHPUnit
- cp qa-tests/phpunit-qa-config.php qa-config.php
script:
# Most of this has been turned off until the code is actually close to passing
# PHP_CodeSniffer
#- phpcs --report=emacs --extensions=php --standard=qa-tests/phpcs/ruleset.xml .
# PHP Mess Detector
#- phpmd --exclude qa-include/vendor/ . text codesize
#- phpmd --exclude qa-include/vendor/ . text unusedcode
# PHP_CodeSniffer (turned off for now)
#- php phpcs.phar --report=emacs --extensions=php --standard=qa-tests/phpcs/ruleset.xml .
# PHP Copy/Paste Detector
- php phpcpd.phar --exclude vendor .
# PHPLOC
- php phploc.phar .
# PHPUnit
- phpunit --bootstrap qa-tests/autoload.php qa-tests
1.7.2
\ No newline at end of file
1.7.3
\ No newline at end of file
......@@ -70,7 +70,7 @@ function qa_recalc_update(elem, state, noteid)
qa_recalc_update(elem, lines[1], noteid);
} else if (lines[0]=='0') {
document.getElementById(noteid).innerHTML=lines[2];
document.getElementById(noteid).innerHTML=lines[1];
qa_recalc_cleanup(elem);
} else {
......
......@@ -83,18 +83,18 @@
$question=$question+qa_page_q_post_rules($question, null, null, $qchildposts); // array union
$answer=$answer+qa_page_q_post_rules($answer, $question, $qchildposts, $achildposts);
foreach ($achildposts as $key => $achildpost)
$achildposts[$key]=$achildpost+qa_page_q_post_rules($achildpost, $answer, $achildposts, null);
$commentsfollows=qa_page_q_load_c_follows($question, $qchildposts, $achildposts);
$achildposts = qa_page_q_load_c_follows($question, array(), $achildposts);
foreach ($commentsfollows as $key => $commentfollow)
$commentsfollows[$key]=$commentfollow+qa_page_q_post_rules($commentfollow, $answer, $commentsfollows, null);
$usershtml=qa_userids_handles_html(array_merge(array($answer), $achildposts), true);
qa_sort_by($achildposts, 'created');
$usershtml=qa_userids_handles_html(array_merge(array($answer), $commentsfollows), true);
qa_sort_by($commentsfollows, 'created');
$a_view=qa_page_q_answer_view($question, $answer, ($answer['postid']==$question['selchildid']) && ($answer['type']=='A'),
$usershtml, false);
$a_view['c_list']=qa_page_q_comment_follow_list($question, $answer, $achildposts, false, $usershtml, false, null);
$a_view['c_list']=qa_page_q_comment_follow_list($question, $answer, $commentsfollows, false, $usershtml, false, null);
$themeclass=qa_load_theme_class(qa_get_site_theme(), 'ajax-answer', null, null);
$themeclass->initialize();
......
......@@ -119,7 +119,7 @@
$blob=qa_db_blob_read($blobid);
if (defined('QA_BLOBS_DIRECTORY') && !isset($blob['content']))
if (isset($blob) && defined('QA_BLOBS_DIRECTORY') && !isset($blob['content']))
$blob['content']=qa_read_blob_file($blobid, $blob['format']);
return $blob;
......@@ -133,7 +133,11 @@
{
if (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }
return file_get_contents(qa_get_blob_filename($blobid, $format));
$filename = qa_get_blob_filename($blobid, $format);
if (is_readable($filename))
return file_get_contents($filename);
else
return null;
}
......
......@@ -118,12 +118,12 @@
foreach ($useridhandles as $useridhandle) {
// only add each user to the array once
$uid = isset($useridhandle['userid']) ? $useridhandle['userid'] : null;
if ($uid && $useridhandle['handle'] && !isset($usershtml[$uid])) {
if ($uid && !isset($usershtml[$uid])) {
$usershtml[$uid] = qa_get_one_user_html($useridhandle['handle'], $microdata, @$favoritemap['user'][$uid]);
}
$luid = isset($useridhandle['lastuserid']) ? $useridhandle['lastuserid'] : null;
if ($luid && $useridhandle['lasthandle'] && !isset($usershtml[$luid])) {
if ($luid && !isset($usershtml[$luid])) {
$usershtml[$luid] = qa_get_one_user_html($useridhandle['lasthandle'], $microdata, @$favoritemap['user'][$luid]);
}
}
......@@ -383,7 +383,7 @@
// Post content
if (@$options['contentview'] && !empty($post['content'])) {
if (@$options['contentview'] && isset($post['content'])) {
$viewer=qa_load_viewer($post['content'], $post['format']);
$fields['content']=$viewer->get_html($post['content'], $post['format'], array(
......@@ -1381,7 +1381,7 @@
if (!$ismyuser)
unset($navigation['favorites']);
if (!$ismyuser || !qa_opt('allow_private_messages') || !qa_opt('show_message_history'))
if (QA_FINAL_EXTERNAL_USERS || !$ismyuser || !qa_opt('allow_private_messages') || !qa_opt('show_message_history'))
unset($navigation['messages']);
return $navigation;
......@@ -1573,7 +1573,7 @@
{
require_once QA_INCLUDE_DIR.'util/string.php';
$text=qa_post_text($fieldname);
$text=qa_remove_utf8mb4(qa_post_text($fieldname));
if (qa_opt('tag_separator_comma'))
return array_unique(preg_split('/\s*,\s*/', trim(qa_strtolower(strtr($text, '/', ' '))), -1, PREG_SPLIT_NO_EMPTY));
......@@ -1970,6 +1970,15 @@
return $viewer->get_html($content, $format, $options);
}
/**
* Retrieve title from HTTP POST, appropriately sanitised.
*/
function qa_get_post_title($fieldname)
{
require_once QA_INCLUDE_DIR.'util/string.php';
return qa_remove_utf8mb4(qa_post_text($fieldname));
}
function qa_get_post_content($editorfield, $contentfield, &$ineditor, &$incontent, &$informat, &$intext)
/*
......@@ -1977,13 +1986,16 @@
Assigns the module's output to $incontent and $informat, editor's name in $ineditor, text rendering of content in $intext
*/
{
$ineditor=qa_post_text($editorfield);
require_once QA_INCLUDE_DIR.'util/string.php';
$ineditor=qa_post_text($editorfield);
$editor=qa_load_module('editor', $ineditor);
$readdata=$editor->read_post($contentfield);
$incontent=$readdata['content'];
// sanitise 4-byte Unicode
$incontent=qa_remove_utf8mb4($readdata['content']);
$informat=$readdata['format'];
$intext=qa_viewer_text($incontent, $informat);
$intext=qa_remove_utf8mb4(qa_viewer_text($incontent, $informat));
}
......
......@@ -437,6 +437,11 @@
if ($oldquestion['type']!='Q_HIDDEN')
qa_fatal_error('Tried to delete a non-hidden question');
$params = array(
'postid' => $oldquestion['postid'],
'oldquestion' => $oldquestion,
);
qa_report_event('q_delete_before', $userid, $handle, $cookieid, $params);
if (isset($oldclosepost) && ($oldclosepost['parentid']==$oldquestion['postid'])) {
......@@ -448,11 +453,6 @@
$useridvotes=qa_db_uservote_post_get($oldquestion['postid']);
$oldpath=qa_db_post_get_category_path($oldquestion['postid']);
$params = array(
'postid' => $oldquestion['postid'],
'oldquestion' => $oldquestion,
);
qa_post_unindex($oldquestion['postid']);
qa_db_post_delete($oldquestion['postid']); // also deletes any related voteds due to foreign key cascading
qa_update_counts_for_q(null);
......
......@@ -36,9 +36,13 @@
*/
{
require_once QA_INCLUDE_DIR.'db/users.php';
require_once QA_INCLUDE_DIR.'util/string.php';
$errors=array();
// sanitise 4-byte Unicode
$handle = qa_remove_utf8mb4($handle);
$filtermodules=qa_load_modules_with('filter', 'filter_handle');
foreach ($filtermodules as $filtermodule) {
......
......@@ -392,7 +392,7 @@
*/
{
return qa_db_read_one_assoc(qa_db_query_sub(
'SELECT blobid, content, format FROM ^blobs WHERE blobid>=# AND content IS NOT NULL',
'SELECT blobid, content, format FROM ^blobs WHERE blobid>=# AND content IS NOT NULL LIMIT 1',
$startblobid
), true);
}
......@@ -413,7 +413,7 @@
*/
{
return qa_db_read_one_assoc(qa_db_query_sub(
'SELECT blobid, format FROM ^blobs WHERE blobid>=# AND content IS NULL',
'SELECT blobid, format FROM ^blobs WHERE blobid>=# AND content IS NULL LIMIT 1',
$startblobid
), true);
}
......@@ -421,4 +421,4 @@
/*
Omit PHP closing tag to help avoid accidental output
*/
\ No newline at end of file
*/
......@@ -639,7 +639,7 @@
{
$selectspec=qa_db_posts_basic_selectspec();
$selectspec['source'].=" WHERE ^posts.postid=(SELECT IF(LEFT(parent.type, 1)='A', parent.parentid, parent.postid) FROM ^posts AS child LEFT JOIN ^posts AS parent ON parent.postid=child.parentid WHERE child.postid=#)";
$selectspec['source'].=" WHERE ^posts.postid=(SELECT IF(LEFT(parent.type, 1)='A', parent.parentid, parent.postid) FROM ^posts AS child LEFT JOIN ^posts AS parent ON parent.postid=child.parentid WHERE child.postid=# AND parent.type IN('Q','A'))";
$selectspec['arguments']=array($postid);
$selectspec['single']=true;
......
......@@ -253,6 +253,9 @@
'flagging_notify_first' => 1,
'max_num_q_tags' => 2,
'max_rate_ip_logins' => 1,
'min_len_a_content' => 1,
'min_len_c_content' => 1,
'min_len_q_title' => 1,
'page_size_activity' => 1,
'page_size_ask_check_qs' => 3,
'page_size_ask_tags' => 3,
......
......@@ -95,7 +95,7 @@ if ($permiterror) {
$captchareason = qa_user_captcha_reason();
$in['title'] = qa_post_text('title'); // allow title and tags to be posted by an external form
$in['title'] = qa_get_post_title('title'); // allow title and tags to be posted by an external form
$in['extra'] = qa_opt('extra_field_active') ? qa_post_text('extra') : null;
if (qa_using_tags()) {
......
......@@ -418,7 +418,7 @@
$in=array();
if ($question['editable']) {
$in['title']=qa_post_text('q_title');
$in['title']=qa_get_post_title('q_title');
qa_get_post_content('q_editor', 'q_content', $in['editor'], $in['content'], $in['format'], $in['text']);
$in['extra']=qa_opt('extra_field_active') ? qa_post_text('q_extra') : null;
}
......
......@@ -399,12 +399,22 @@
if (isset($closepost)) {
if ($closepost['basetype']=='Q') {
$q_view['closed']=array(
'state' => qa_lang_html('main/closed'),
'label' => qa_lang_html('question/closed_as_duplicate'),
'content' => qa_html(qa_block_words_replace($closepost['title'], qa_get_block_words_preg())),
'url' => qa_q_path_html($closepost['postid'], $closepost['title']),
);
if ($closepost['hidden']) {
// don't show link for hidden questions
$q_view['closed']=array(
'state' => qa_lang_html('main/closed'),
'label' => qa_lang_html('main/closed'),
'content' => '',
);
}
else {
$q_view['closed']=array(
'state' => qa_lang_html('main/closed'),
'label' => qa_lang_html('question/closed_as_duplicate'),
'content' => qa_html(qa_block_words_replace($closepost['title'], qa_get_block_words_preg())),
'url' => qa_q_path_html($closepost['postid'], $closepost['title']),
);
}
} elseif ($closepost['type']=='NOTE') {
$viewer=qa_load_viewer($closepost['content'], $closepost['format']);
......
......@@ -32,7 +32,7 @@
if (!strlen($handle)) {
$handle = qa_get_logged_in_handle();
qa_redirect(isset($handle) ? 'user/'.$handle : 'users');
qa_redirect(!empty($handle) ? 'user/'.$handle : 'users');
}
......
......@@ -70,6 +70,10 @@ class qa_filter_basic
$this->validate_field_length($errors, $question, 'content', 0, QA_DB_MAX_CONTENT_LENGTH); // for storage
$this->validate_field_length($errors, $question, 'text', qa_opt('min_len_q_content'), null); // for display
// ensure content error is shown
if (isset($errors['text'])) {
$errors['content'] = $errors['text'];
}
if (isset($question['tags'])) {
$counttags = count($question['tags']);
......@@ -149,7 +153,7 @@ class qa_filter_basic
$errorKey = $key;
}
// skip the field is key not set (for example, 'title' when recategorizing questions)
// skip the field if key not set (for example, 'title' when recategorizing questions)
if (array_key_exists($key, $post)) {
$length = qa_strlen($post[$key]);
......
......@@ -21,8 +21,8 @@
*/
define('QA_VERSION', '1.7.2'); // also used as suffix for .js and .css requests
define('QA_BUILD_DATE', '2015-11-05');
define('QA_VERSION', '1.7.3'); // also used as suffix for .js and .css requests
define('QA_BUILD_DATE', '2016-01-29');
/**
......
......@@ -47,7 +47,7 @@ qa_db_connect('qa_blob_db_fail_handler');
$blob = qa_read_blob(qa_get('qa_blobid'));
if (isset($blob)) {
if (isset($blob) && isset($blob['content'])) {
// allows browsers and proxies to cache the blob (30 days)
header('Cache-Control: max-age=2592000, public');
......
......@@ -36,7 +36,7 @@
{
return array(
'login' => wp_login_url(qa_opt('site_url').$redirect_back_to_url),
'register' => site_url('wp-login.php?action=register'),
'register' => function_exists('wp_registration_url') ? wp_registration_url() : site_url('wp-login.php?action=register'),
'logout' => strtr(wp_logout_url(), array('&amp;' => '&')),
);
}
......@@ -163,4 +163,4 @@
/*
Omit PHP closing tag to help avoid accidental output
*/
\ No newline at end of file
*/
......@@ -534,6 +534,20 @@
return $string;
}
/**
* Removes 4-byte Unicode characters (e.g. emoji) from a string due to missing support in MySQL < 5.5.3.
* @param string $string
* @return string
*/
function qa_remove_utf8mb4($string)
{
return preg_replace('%(?:
\xF0[\x90-\xBF][\x80-\xBF]{2} # planes 1-3
| [\xF1-\xF3][\x80-\xBF]{3} # planes 4-15
| \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16
)%xs', '', $string);
}
function qa_block_words_explode($wordstring)
/*
......
......@@ -29,66 +29,66 @@ class PHPMailer
{
/**
* The PHPMailer Version number.
* @type string
* @var string
*/
public $Version = '5.2.13';
public $Version = '5.2.14';
/**
* Email priority.
* Options: null (default), 1 = High, 3 = Normal, 5 = low.
* When null, the header is not set at all.
* @type integer
* @var integer
*/
public $Priority = null;
/**
* The character set of the message.
* @type string
* @var string
*/
public $CharSet = 'iso-8859-1';
/**
* The MIME Content-type of the message.
* @type string
* @var string
*/
public $ContentType = 'text/plain';
/**
* The message encoding.
* Options: "8bit", "7bit", "binary", "base64", and "quoted-printable".
* @type string
* @var string
*/
public $Encoding = '8bit';
/**
* Holds the most recent mailer error message.
* @type string
* @var string
*/
public $ErrorInfo = '';
/**
* The From email address for the message.
* @type string
* @var string
*/
public $From = 'root@localhost';
/**
* The From name of the message.
* @type string
* @var string
*/
public $FromName = 'Root User';
/**
* The Sender email (Return-Path) of the message.
* If not empty, will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.
* @type string
* @var string
*/
public $Sender = '';
/**
* The Return-Path of the message.
* If empty, it will be set to either From or Sender.
* @type string
* @var string
* @deprecated Email senders should never set a return-path header;
* it's the receiver's job (RFC5321 section 4.4), so this no longer does anything.
* @link https://tools.ietf.org/html/rfc5321#section-4.4 RFC5321 reference
......@@ -97,14 +97,14 @@ class PHPMailer
/**
* The Subject of the message.
* @type string
* @var string
*/
public $Subject = '';
/**
* An HTML or plain text message body.
* If HTML then call isHTML(true).
* @type string
* @var string
*/
public $Body = '';
......@@ -113,7 +113,7 @@ class PHPMailer
* This body can be read by mail clients that do not have HTML email
* capability such as mutt & Eudora.
* Clients that can read HTML will view the normal Body.
* @type string
* @var string
*/
public $AltBody = '';
......@@ -123,27 +123,27 @@ class PHPMailer
* To generate iCal events, use the bundled extras/EasyPeasyICS.php class or iCalcreator
* @link http://sprain.ch/blog/downloads/php-class-easypeasyics-create-ical-files-with-php/
* @link http://kigkonsult.se/iCalcreator/
* @type string
* @var string
*/
public $Ical = '';
/**
* The complete compiled MIME message body.
* @access protected
* @type string
* @var string
*/
protected $MIMEBody = '';
/**
* The complete compiled MIME message headers.
* @type string
* @var string
* @access protected
*/
protected $MIMEHeader = '';
/**
* Extra headers that createHeader() doesn't fold in.
* @type string
* @var string
* @access protected
*/
protected $mailHeader = '';
......@@ -151,64 +151,64 @@ class PHPMailer
/**
* Word-wrap the message body to this number of chars.
* Set to 0 to not wrap. A useful value here is 78, for RFC2822 section 2.1.1 compliance.
* @type integer
* @var integer
*/
public $WordWrap = 0;
/**
* Which method to use to send mail.
* Options: "mail", "sendmail", or "smtp".
* @type string
* @var string
*/
public $Mailer = 'mail';
/**
* The path to the sendmail program.
* @type string
* @var string
*/
public $Sendmail = '/usr/sbin/sendmail';
/**
* Whether mail() uses a fully sendmail-compatible MTA.
* One which supports sendmail's "-oi -f" options.
* @type boolean
* @var boolean
*/
public $UseSendmailOptions = true;
/**
* Path to PHPMailer plugins.
* Useful if the SMTP class is not in the PHP include path.
* @type string
* @var string
* @deprecated Should not be needed now there is an autoloader.
*/
public $PluginDir = '';
/**
* The email address that a reading confirmation should be sent to.
* @type string
* The email address that a reading confirmation should be sent to, also known as read receipt.
* @var string
*/
public $ConfirmReadingTo = '';
/**
* The hostname to use in Message-Id and Received headers
* and as default HELO string.
* If empty, the value returned
* by SERVER_NAME is used or 'localhost.localdomain'.
* @type string
* The hostname to use in the Message-ID header and as default HELO string.
* If empty, PHPMailer attempts to find one with, in order,
* $_SERVER['SERVER_NAME'], gethostname(), php_uname('n'), or the value
* 'localhost.localdomain'.
* @var string
*/
public $Hostname = '';
/**
* An ID to be used in the Message-Id header.
* An ID to be used in the Message-ID header.
* If empty, a unique id will be generated.
* @type string
* @var string
*/
public $MessageID = '';
/**
* The message Date to be used in the Date header.
* If empty, the current date will be added.
* @type string
* @var string
*/
public $MessageDate = '';
......@@ -221,21 +221,22 @@ class PHPMailer
* You can also specify encryption type, for example:
* (e.g. "tls://smtp1.example.com:587;ssl://smtp2.example.com:465").
* Hosts will be tried in order.
* @type string
* @var string
*/
public $Host = 'localhost';
/**
* The default SMTP server port.
* @type integer
* @var integer
* @TODO Why is this needed when the SMTP class takes care of it?
*/
public $Port = 25;
/**
* The SMTP HELO of the message.
* Default is $Hostname.
* @type string
* Default is $Hostname. If $Hostname is empty, PHPMailer attempts to find
* one with the same method described above for $Hostname.
* @var string
* @see PHPMailer::$Hostname
*/
public $Helo = '';
......@@ -243,7 +244,7 @@ class PHPMailer
/**
* What kind of encryption to use on the SMTP connection.
* Options: '', 'ssl' or 'tls'
* @type string
* @var string
*/
public $SMTPSecure = '';
......@@ -251,14 +252,14 @@ class PHPMailer
* Whether to enable TLS encryption automatically if a server supports it,
* even if `SMTPSecure` is not set to 'tls'.
* Be aware that in PHP >= 5.6 this requires that the server's certificates are valid.
* @type boolean
* @var boolean
*/
public $SMTPAutoTLS = true;
/**
* Whether to use SMTP authentication.
* Uses the Username and Password properties.
* @type boolean
* @var boolean
* @see PHPMailer::$Username
* @see PHPMailer::$Password
*/
......@@ -266,47 +267,47 @@ class PHPMailer
/**
* Options array passed to stream_context_create when connecting via SMTP.
* @type array
* @var array
*/
public $SMTPOptions = array();
/**
* SMTP username.
* @type string
* @var string
*/
public $Username = '';
/**
* SMTP password.
* @type string
* @var string
*/
public $Password = '';
/**
* SMTP auth type.
* Options are LOGIN (default), PLAIN, NTLM, CRAM-MD5
* @type string
* @var string
*/
public $AuthType = '';
/**
* SMTP realm.
* Used for NTLM auth
* @type string
* @var string
*/
public $Realm = '';
/**
* SMTP workstation.
* Used for NTLM auth
* @type string
* @var string
*/
public $Workstation = '';
/**
* The SMTP server timeout in seconds.
* Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2
* @type integer
* @var integer
*/
public $Timeout = 300;
......@@ -319,7 +320,7 @@ class PHPMailer
* * `2` Data and commands
* * `3` As 2 plus connection status
* * `4` Low-level data output
* @type integer
* @var integer
* @see SMTP::$do_debug
*/
public $SMTPDebug = 0;
......@@ -335,7 +336,7 @@ class PHPMailer
* <code>
* $mail->Debugoutput = function($str, $level) {echo "debug level $level; message: $str";};
* </code>
* @type string|callable
* @var string|callable
* @see SMTP::$Debugoutput
*/
public $Debugoutput = 'echo';
......@@ -344,20 +345,20 @@ class PHPMailer
* Whether to keep SMTP connection open after each message.
* If this is set to true then to close the connection
* requires an explicit call to smtpClose().
* @type boolean
* @var boolean
*/
public $SMTPKeepAlive = false;
/**
* Whether to split multiple to addresses into multiple messages
* or send them all in one message.
* @type boolean
* @var boolean
*/
public $SingleTo = false;
/**
* Storage for addresses when SingleTo is enabled.
* @type array
* @var array
* @TODO This should really not be public
*/
public $SingleToArray = array();
......@@ -365,15 +366,15 @@ class PHPMailer
/**
* Whether to generate VERP addresses on send.
* Only applicable when sending via SMTP.
* @link http://en.wikipedia.org/wiki/Variable_envelope_return_path
* @link https://en.wikipedia.org/wiki/Variable_envelope_return_path
* @link http://www.postfix.org/VERP_README.html Postfix VERP info
* @type boolean
* @var boolean
*/
public $do_verp = false;
/**
* Whether to allow sending messages with an empty body.
* @type boolean
* @var boolean
*/
public $AllowEmpty = false;
......@@ -381,40 +382,40 @@ class PHPMailer
* The default line ending.
* @note The default remains "\n". We force CRLF where we know
* it must be used via self::CRLF.
* @type string
* @var string
*/
public $LE = "\n";
/**
* DKIM selector.
* @type string
* @var string
*/
public $DKIM_selector = '';
/**
* DKIM Identity.
* Usually the email address used as the source of the email
* @type string
* @var string
*/
public $DKIM_identity = '';
/**
* DKIM passphrase.
* Used if your key is encrypted.
* @type string
* @var string
*/
public $DKIM_passphrase = '';
/**
* DKIM signing domain name.
* @example 'example.com'
* @type string
* @var string
*/
public $DKIM_domain = '';
/**
* DKIM private key file path.
* @type string
* @var string
*/
public $DKIM_private = '';
......@@ -434,59 +435,48 @@ class PHPMailer
* string $subject the subject
* string $body the email body
* string $from email address of sender
* @type string
* @var string
*/
public $action_function = '';
/**
* What to put in the X-Mailer header.
* Options: An empty string for PHPMailer default, whitespace for none, or a string to use
* @type string
* @var string
*/
public $XMailer = '';
/**
* Only For XOAUTH - Google
* Options: An empty string for PHPMailer default, Enter the email used to get access token
* @type string
*/
// public $UserEmail = '';
// public $RefreshToken = '';
// public $ClientId = '';
// public $ClientSecret = '';
/**
* An instance of the SMTP sender class.
* @type SMTP
* @var SMTP
* @access protected
*/
protected $smtp = null;
/**
* The array of 'to' addresses.
* @type array
* The array of 'to' names and addresses.
* @var array
* @access protected
*/
protected $to = array();
/**
* The array of 'cc' addresses.
* @type array
* The array of 'cc' names and addresses.
* @var array
* @access protected
*/
protected $cc = array();
/**
* The array of 'bcc' addresses.
* @type array
* The array of 'bcc' names and addresses.
* @var array
* @access protected
*/
protected $bcc = array();
/**
* The array of reply-to names and addresses.
* @type array
* @var array
* @access protected
*/
protected $ReplyTo = array();
......@@ -494,77 +484,100 @@ class PHPMailer
/**
* An array of all kinds of addresses.
* Includes all of $to, $cc, $bcc
* @type array
* @var array
* @access protected
* @see PHPMailer::$to @see PHPMailer::$cc @see PHPMailer::$bcc
*/
protected $all_recipients = array();
/**
* An array of names and addresses queued for validation.
* In send(), valid and non duplicate entries are moved to $all_recipients
* and one of $to, $cc, or $bcc.
* This array is used only for addresses with IDN.
* @var array
* @access protected
* @see PHPMailer::$to @see PHPMailer::$cc @see PHPMailer::$bcc
* @see PHPMailer::$all_recipients
*/
protected $RecipientsQueue = array();
/**
* An array of reply-to names and addresses queued for validation.
* In send(), valid and non duplicate entries are moved to $ReplyTo.
* This array is used only for addresses with IDN.
* @var array
* @access protected
* @see PHPMailer::$ReplyTo
*/
protected $ReplyToQueue = array();
/**
* The array of attachments.
* @type array
* @var array
* @access protected
*/
protected $attachment = array();
/**
* The array of custom headers.
* @type array
* @var array
* @access protected
*/
protected $CustomHeader = array();
/**
* The most recent Message-ID (including angular brackets).
* @type string
* @var string
* @access protected
*/
protected $lastMessageID = '';
/**
* The message's MIME type.
* @type string
* @var string
* @access protected
*/
protected $message_type = '';
/**
* The array of MIME boundary strings.
* @type array
* @var array
* @access protected
*/
protected $boundary = array();
/**
* The array of available languages.
* @type array
* @var array
* @access protected
*/
protected $language = array();
/**
* The number of errors encountered.
* @type integer
* @var integer
* @access protected
*/
protected $error_count = 0;
/**
* The S/MIME certificate file path.
* @type string
* @var string
* @access protected
*/
protected $sign_cert_file = '';
/**
* The S/MIME key file path.
* @type string
* @var string
* @access protected
*/
protected $sign_key_file = '';
/**
* The optional S/MIME extra certificates ("CA Chain") file path.
* @type string
* @var string
* @access protected
*/
protected $sign_extracerts_file = '';
......@@ -572,21 +585,21 @@ class PHPMailer
/**
* The S/MIME password for the key.
* Used only if the key is encrypted.
* @type string
* @var string
* @access protected
*/
protected $sign_key_pass = '';
/**
* Whether to throw exceptions for errors.
* @type boolean
* @var boolean
* @access protected
*/
protected $exceptions = false;
/**
* Unique ID used for message ID and boundaries.
* @type string
* @var string
* @access protected
*/
protected $uniqueid = '';
......@@ -613,7 +626,7 @@ class PHPMailer
/**
* The maximum line length allowed by RFC 2822 section 2.1.1
* @type integer
* @var integer
*/
const MAX_LINE_LENGTH = 998;
......@@ -775,55 +788,101 @@ class PHPMailer
/**
* Add a "To" address.
* @param string $address
* @param string $address The email address to send to
* @param string $name
* @return boolean true on success, false if address already used
* @return boolean true on success, false if address already used or invalid in some way
*/
public function addAddress($address, $name = '')
{
return $this->addAnAddress('to', $address, $name);
return $this->addOrEnqueueAnAddress('to', $address, $name);
}
/**
* Add a "CC" address.
* @note: This function works with the SMTP mailer on win32, not with the "mail" mailer.
* @param string $address
* @param string $address The email address to send to
* @param string $name
* @return boolean true on success, false if address already used
* @return boolean true on success, false if address already used or invalid in some way
*/
public function addCC($address, $name = '')
{
return $this->addAnAddress('cc', $address, $name);
return $this->addOrEnqueueAnAddress('cc', $address, $name);
}
/**
* Add a "BCC" address.
* @note: This function works with the SMTP mailer on win32, not with the "mail" mailer.
* @param string $address
* @param string $address The email address to send to
* @param string $name
* @return boolean true on success, false if address already used
* @return boolean true on success, false if address already used or invalid in some way
*/
public function addBCC($address, $name = '')
{
return $this->addAnAddress('bcc', $address, $name);
return $this->addOrEnqueueAnAddress('bcc', $address, $name);
}
/**
* Add a "Reply-to" address.
* @param string $address
* Add a "Reply-To" address.
* @param string $address The email address to reply to
* @param string $name
* @return boolean
* @return boolean true on success, false if address already used or invalid in some way
*/
public function addReplyTo($address, $name = '')
{
return $this->addAnAddress('Reply-To', $address, $name);
return $this->addOrEnqueueAnAddress('Reply-To', $address, $name);
}
/**
* Add an address to one of the recipient arrays.
* Addresses that have been added already return false, but do not throw exceptions
* @param string $kind One of 'to', 'cc', 'bcc', 'ReplyTo'
* @param string $address The email address to send to
* Add an address to one of the recipient arrays or to the ReplyTo array. Because PHPMailer
* can't validate addresses with an IDN without knowing the PHPMailer::$CharSet (that can still
* be modified after calling this function), addition of such addresses is delayed until send().
* Addresses that have been added already return false, but do not throw exceptions.
* @param string $kind One of 'to', 'cc', 'bcc', or 'ReplyTo'
* @param string $address The email address to send, resp. to reply to
* @param string $name
* @throws phpmailerException
* @return boolean true on success, false if address already used or invalid in some way
* @access protected
*/
protected function addOrEnqueueAnAddress($kind, $address, $name)
{
$address = trim($address);
$name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
if (($pos = strrpos($address, '@')) === false) {
// At-sign is misssing.
$error_message = $this->lang('invalid_address') . $address;
$this->setError($error_message);
$this->edebug($error_message);
if ($this->exceptions) {
throw new phpmailerException($error_message);
}
return false;
}
$params = array($kind, $address, $name);
// Enqueue addresses with IDN until we know the PHPMailer::$CharSet.
if ($this->has8bitChars(substr($address, ++$pos)) and $this->idnSupported()) {
if ($kind != 'Reply-To') {
if (!array_key_exists($address, $this->RecipientsQueue)) {
$this->RecipientsQueue[$address] = $params;
return true;
}
} else {
if (!array_key_exists($address, $this->ReplyToQueue)) {
$this->ReplyToQueue[$address] = $params;
return true;
}
}
return false;
}
// Immediately add standard addresses without IDN.
return call_user_func_array(array($this, 'addAnAddress'), $params);
}
/**
* Add an address to one of the recipient arrays or to the ReplyTo array.
* Addresses that have been added already return false, but do not throw exceptions.
* @param string $kind One of 'to', 'cc', 'bcc', or 'ReplyTo'
* @param string $address The email address to send, resp. to reply to
* @param string $name
* @throws phpmailerException
* @return boolean true on success, false if address already used or invalid in some way
......@@ -831,26 +890,26 @@ class PHPMailer
*/
protected function addAnAddress($kind, $address, $name = '')
{
if (!preg_match('/^(to|cc|bcc|Reply-To)$/', $kind)) {
$this->setError($this->lang('Invalid recipient array') . ': ' . $kind);
$this->edebug($this->lang('Invalid recipient array') . ': ' . $kind);
if (!in_array($kind, array('to', 'cc', 'bcc', 'Reply-To'))) {
$error_message = $this->lang('Invalid recipient kind: ') . $kind;
$this->setError($error_message);
$this->edebug($error_message);
if ($this->exceptions) {
throw new phpmailerException('Invalid recipient array: ' . $kind);
throw new phpmailerException($error_message);
}
return false;
}
$address = trim($address);
$name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
if (!$this->validateAddress($address)) {
$this->setError($this->lang('invalid_address') . ': ' . $address);
$this->edebug($this->lang('invalid_address') . ': ' . $address);
$error_message = $this->lang('invalid_address') . $address;
$this->setError($error_message);
$this->edebug($error_message);
if ($this->exceptions) {
throw new phpmailerException($this->lang('invalid_address') . ': ' . $address);
throw new phpmailerException($error_message);
}
return false;
}
if ($kind != 'Reply-To') {
if (!isset($this->all_recipients[strtolower($address)])) {
if (!array_key_exists(strtolower($address), $this->all_recipients)) {
array_push($this->$kind, array($address, $name));
$this->all_recipients[strtolower($address)] = true;
return true;
......@@ -931,11 +990,15 @@ class PHPMailer
{
$address = trim($address);
$name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
if (!$this->validateAddress($address)) {
$this->setError($this->lang('invalid_address') . ': ' . $address);
$this->edebug($this->lang('invalid_address') . ': ' . $address);
// Don't validate now addresses with IDN. Will be done in send().
if (($pos = strrpos($address, '@')) === false or
(!$this->has8bitChars(substr($address, ++$pos)) or !$this->idnSupported()) and
!$this->validateAddress($address)) {
$error_message = $this->lang('invalid_address') . $address;
$this->setError($error_message);
$this->edebug($error_message);
if ($this->exceptions) {
throw new phpmailerException($this->lang('invalid_address') . ': ' . $address);
throw new phpmailerException($error_message);
}
return false;
}
......@@ -965,10 +1028,10 @@ class PHPMailer
* Check that a string looks like an email address.
* @param string $address The email address to check
* @param string $patternselect A selector for the validation pattern to use :
* * `auto` Pick strictest one automatically;
* * `auto` Pick best pattern automatically;
* * `pcre8` Use the squiloople.com pattern, requires PCRE > 8.0, PHP >= 5.3.2, 5.2.14;
* * `pcre` Use old PCRE implementation;
* * `php` Use PHP built-in FILTER_VALIDATE_EMAIL; same as pcre8 but does not allow 'dotless' domains;
* * `php` Use PHP built-in FILTER_VALIDATE_EMAIL;
* * `html5` Use the pattern given by the HTML5 spec for 'email' type form input elements.
* * `noregex` Don't use a regex: super fast, really dumb.
* @return boolean
......@@ -977,6 +1040,10 @@ class PHPMailer
*/
public static function validateAddress($address, $patternselect = 'auto')
{
//Reject line breaks in addresses; it's valid RFC5322, but not RFC5321
if (strpos($address, "\n") !== false or strpos($address, "\r") !== false) {
return false;
}
if (!$patternselect or $patternselect == 'auto') {
//Check this constant first so it works when extension_loaded() is disabled by safe mode
//Constant was added in PHP 5.2.4
......@@ -1057,6 +1124,48 @@ class PHPMailer
}
/**
* Tells whether IDNs (Internationalized Domain Names) are supported or not. This requires the
* "intl" and "mbstring" PHP extensions.
* @return bool "true" if required functions for IDN support are present
*/
public function idnSupported()
{
// @TODO: Write our own "idn_to_ascii" function for PHP <= 5.2.
return function_exists('idn_to_ascii') and function_exists('mb_convert_encoding');
}
/**
* Converts IDN in given email address to its ASCII form, also known as punycode, if possible.
* Important: Address must be passed in same encoding as currently set in PHPMailer::$CharSet.
* This function silently returns unmodified address if:
* - No conversion is necessary (i.e. domain name is not an IDN, or is already in ASCII form)
* - Conversion to punycode is impossible (e.g. required PHP functions are not available)
* or fails for any reason (e.g. domain has characters not allowed in an IDN)
* @see PHPMailer::$CharSet
* @param string $address The email address to convert
* @return string The encoded address in ASCII form
*/
public function punyencodeAddress($address)
{
// Verify we have required functions, CharSet, and at-sign.
if ($this->idnSupported() and
!empty($this->CharSet) and
($pos = strrpos($address, '@')) !== false) {
$domain = substr($address, ++$pos);
// Verify CharSet string is a valid one, and domain properly encoded in this CharSet.
if ($this->has8bitChars($domain) and @mb_check_encoding($domain, $this->CharSet)) {
$domain = mb_convert_encoding($domain, 'UTF-8', $this->CharSet);
if (($punycode = defined('INTL_IDNA_VARIANT_UTS46') ?
idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46) :
idn_to_ascii($domain)) !== false) {
return substr($address, 0, $pos) . $punycode;
}
}
}
return $address;
}
/**
* Create a message and send it.
* Uses the sending method specified by $Mailer.
* @throws phpmailerException
......@@ -1087,17 +1196,41 @@ class PHPMailer
public function preSend()
{
try {
$this->error_count = 0; // Reset errors
$this->mailHeader = '';
// Dequeue recipient and Reply-To addresses with IDN
foreach (array_merge($this->RecipientsQueue, $this->ReplyToQueue) as $params) {
$params[1] = $this->punyencodeAddress($params[1]);
call_user_func_array(array($this, 'addAnAddress'), $params);
}
if ((count($this->to) + count($this->cc) + count($this->bcc)) < 1) {
throw new phpmailerException($this->lang('provide_address'), self::STOP_CRITICAL);
}
// Validate From, Sender, and ConfirmReadingTo addresses
foreach (array('From', 'Sender', 'ConfirmReadingTo') as $address_kind) {
$this->$address_kind = trim($this->$address_kind);
if (empty($this->$address_kind)) {
continue;
}
$this->$address_kind = $this->punyencodeAddress($this->$address_kind);
if (!$this->validateAddress($this->$address_kind)) {
$error_message = $this->lang('invalid_address') . $this->$address_kind;
$this->setError($error_message);
$this->edebug($error_message);
if ($this->exceptions) {
throw new phpmailerException($error_message);
}
return false;
}
}
// Set whether the message is multipart/alternative
if (!empty($this->AltBody)) {
$this->ContentType = 'multipart/alternative';
}
$this->error_count = 0; // Reset errors
$this->setMessageType();
// Refuse to send an empty message unless we are specifically allowing it
if (!$this->AllowEmpty and empty($this->Body)) {
......@@ -1238,7 +1371,15 @@ class PHPMailer
fputs($mail, $header);
fputs($mail, $body);
$result = pclose($mail);
$this->doCallback(($result == 0), $this->to, $this->cc, $this->bcc, $this->Subject, $body, $this->From);
$this->doCallback(
($result == 0),
$this->to,
$this->cc,
$this->bcc,
$this->Subject,
$body,
$this->From
);
if ($result != 0) {
throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
}
......@@ -1384,7 +1525,7 @@ class PHPMailer
if (is_null($this->smtp)) {
$this->smtp = $this->getSMTPInstance();
}
// Already connected?
if ($this->smtp->connected()) {
return true;
......@@ -1459,10 +1600,10 @@ class PHPMailer
}
if ($this->SMTPAuth) {
if (!$this->smtp->authenticate(
$this->Username,
$this->Password,
$this->AuthType,
$this->Realm,
$this->Username,
$this->Password,
$this->AuthType,
$this->Realm,
$this->Workstation
)
) {
......@@ -1524,7 +1665,7 @@ class PHPMailer
'file_open' => 'File Error: Could not open file: ',
'from_failed' => 'The following From address failed: ',
'instantiate' => 'Could not instantiate mail function.',
'invalid_address' => 'Invalid address',
'invalid_address' => 'Invalid address: ',
'mailer_not_supported' => ' mailer is not supported.',
'provide_address' => 'You must provide at least one recipient email address.',
'recipients_failed' => 'SMTP Error: The following recipients failed: ',
......@@ -1789,7 +1930,6 @@ class PHPMailer
}
$result .= $this->headerLine('Date', $this->MessageDate);
// To be created automatically by mail()
if ($this->SingleTo) {
if ($this->Mailer != 'mail') {
......@@ -1835,7 +1975,7 @@ class PHPMailer
if ($this->MessageID != '') {
$this->lastMessageID = $this->MessageID;
} else {
$this->lastMessageID = sprintf('<%s@%s>', $this->uniqueid, $this->ServerHostname());
$this->lastMessageID = sprintf('<%s@%s>', $this->uniqueid, $this->serverHostname());
}
$result .= $this->headerLine('Message-ID', $this->lastMessageID);
if (!is_null($this->Priority)) {
......@@ -1844,7 +1984,7 @@ class PHPMailer
if ($this->XMailer == '') {
$result .= $this->headerLine(
'X-Mailer',
'PHPMailer ' . $this->Version . ' (https://github.com/PHPMailer/PHPMailer/)'
'PHPMailer ' . $this->Version . ' (https://github.com/PHPMailer/PHPMailer)'
);
} else {
$myXmailer = trim($this->XMailer);
......@@ -1854,7 +1994,7 @@ class PHPMailer
}
if ($this->ConfirmReadingTo != '') {
$result .= $this->headerLine('Disposition-Notification-To', '<' . trim($this->ConfirmReadingTo) . '>');
$result .= $this->headerLine('Disposition-Notification-To', '<' . $this->ConfirmReadingTo . '>');
}
// Add custom headers
......@@ -2335,7 +2475,7 @@ class PHPMailer
$type = $attachment[4];
$disposition = $attachment[6];
$cid = $attachment[7];
if ($disposition == 'inline' && isset($cidUniq[$cid])) {
if ($disposition == 'inline' && array_key_exists($cid, $cidUniq)) {
continue;
}
$cidUniq[$cid] = true;
......@@ -2426,7 +2566,6 @@ class PHPMailer
* @param string $path The full path to the file
* @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable'
* @throws phpmailerException
* @see EncodeFile(encodeFile
* @access protected
* @return string
*/
......@@ -2723,7 +2862,6 @@ class PHPMailer
return str_replace(' ', '_', $encoded);
}
/**
* Add a string or binary attachment (non-filesystem).
* This method can be used to attach ascii or binary data,
......@@ -2886,6 +3024,22 @@ class PHPMailer
}
/**
* Clear queued addresses of given kind.
* @access protected
* @param string $kind 'to', 'cc', or 'bcc'
* @return void
*/
public function clearQueuedAddresses($kind)
{
$RecipientsQueue = $this->RecipientsQueue;
foreach ($RecipientsQueue as $address => $params) {
if ($params[0] == $kind) {
unset($this->RecipientsQueue[$address]);
}
}
}
/**
* Clear all To recipients.
* @return void
*/
......@@ -2895,6 +3049,7 @@ class PHPMailer
unset($this->all_recipients[strtolower($to[0])]);
}
$this->to = array();
$this->clearQueuedAddresses('to');
}
/**
......@@ -2907,6 +3062,7 @@ class PHPMailer
unset($this->all_recipients[strtolower($cc[0])]);
}
$this->cc = array();
$this->clearQueuedAddresses('cc');
}
/**
......@@ -2919,6 +3075,7 @@ class PHPMailer
unset($this->all_recipients[strtolower($bcc[0])]);
}
$this->bcc = array();
$this->clearQueuedAddresses('bcc');
}
/**
......@@ -2928,6 +3085,7 @@ class PHPMailer
public function clearReplyTos()
{
$this->ReplyTo = array();
$this->ReplyToQueue = array();
}
/**
......@@ -2940,6 +3098,7 @@ class PHPMailer
$this->cc = array();
$this->bcc = array();
$this->all_recipients = array();
$this->RecipientsQueue = array();
}
/**
......@@ -3096,8 +3255,7 @@ class PHPMailer
}
/**
* Returns all custom headers
*
* Returns all custom headers.
* @return array
*/
public function getCustomHeaders()
......@@ -3114,13 +3272,13 @@ class PHPMailer
* @param string $message HTML message string
* @param string $basedir baseline directory for path
* @param boolean|callable $advanced Whether to use the internal HTML to text converter
* or your own custom converter @see html2text()
* or your own custom converter @see PHPMailer::html2text()
* @return string $message
*/
public function msgHTML($message, $basedir = '', $advanced = false)
{
preg_match_all('/(src|background)=["\'](.*)["\']/Ui', $message, $images);
if (isset($images[2])) {
if (array_key_exists(2, $images)) {
foreach ($images[2] as $imgindex => $url) {
// Convert data URIs into embedded images
if (preg_match('#^data:(image[^;,]*)(;base64)?,#', $url, $match)) {
......@@ -3140,7 +3298,7 @@ class PHPMailer
}
} elseif (substr($url, 0, 4) !== 'cid:' && !preg_match('#^[A-z]+://#', $url)) {
// Do not change urls for absolute images (thanks to corvuscorax)
// Do not change urls that are already inline images
// Do not change urls that are already inline images
$filename = basename($url);
$directory = dirname($url);
if ($directory == '.') {
......@@ -3444,7 +3602,6 @@ class PHPMailer
return preg_replace('/(\r\n|\r|\n)/ms', $breaktype, $text);
}
/**
* Set the public and private key files and password for S/MIME signing.
* @access public
......@@ -3613,7 +3770,10 @@ class PHPMailer
"\tbh=" . $DKIMb64 . ";\r\n" .
"\tb=";
$toSign = $this->DKIM_HeaderC(
$from_header . "\r\n" . $to_header . "\r\n" . $subject_header . "\r\n" . $dkimhdrs
$from_header . "\r\n" .
$to_header . "\r\n" .
$subject_header . "\r\n" .
$dkimhdrs
);
$signed = $this->DKIM_Sign($toSign);
return $dkimhdrs . $signed . "\r\n";
......@@ -3633,6 +3793,7 @@ class PHPMailer
/**
* Allows for public read access to 'to' property.
* @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included.
* @access public
* @return array
*/
......@@ -3643,6 +3804,7 @@ class PHPMailer
/**
* Allows for public read access to 'cc' property.
* @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included.
* @access public
* @return array
*/
......@@ -3653,6 +3815,7 @@ class PHPMailer
/**
* Allows for public read access to 'bcc' property.
* @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included.
* @access public
* @return array
*/
......@@ -3663,6 +3826,7 @@ class PHPMailer
/**
* Allows for public read access to 'ReplyTo' property.
* @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included.
* @access public
* @return array
*/
......@@ -3673,6 +3837,7 @@ class PHPMailer
/**
* Allows for public read access to 'all_recipients' property.
* @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included.
* @access public
* @return array
*/
......
......@@ -28,25 +28,25 @@ class SMTP
{
/**
* The PHPMailer SMTP version number.
* @type string
* @var string
*/
const VERSION = '5.2.13';
const VERSION = '5.2.14';
/**
* SMTP line break constant.
* @type string
* @var string
*/
const CRLF = "\r\n";
/**
* The SMTP port to use if one is not specified.
* @type integer
* @var integer
*/
const DEFAULT_SMTP_PORT = 25;
/**
* The maximum line length allowed by RFC 2822 section 2.1.1
* @type integer
* @var integer
*/
const MAX_LINE_LENGTH = 998;
......@@ -77,15 +77,15 @@ class SMTP
/**
* The PHPMailer SMTP Version number.
* @type string
* @var string
* @deprecated Use the `VERSION` constant instead
* @see SMTP::VERSION
*/
public $Version = '5.2.13';
public $Version = '5.2.14';
/**
* SMTP server port number.
* @type integer
* @var integer
* @deprecated This is only ever used as a default value, so use the `DEFAULT_SMTP_PORT` constant instead
* @see SMTP::DEFAULT_SMTP_PORT
*/
......@@ -93,7 +93,7 @@ class SMTP
/**
* SMTP reply line ending.
* @type string
* @var string
* @deprecated Use the `CRLF` constant instead
* @see SMTP::CRLF
*/
......@@ -107,7 +107,7 @@ class SMTP
* * self::DEBUG_SERVER (`2`) Client commands and server responses
* * self::DEBUG_CONNECTION (`3`) As DEBUG_SERVER plus connection status
* * self::DEBUG_LOWLEVEL (`4`) Low-level data output, all messages
* @type integer
* @var integer
*/
public $do_debug = self::DEBUG_OFF;
......@@ -122,7 +122,7 @@ class SMTP
* <code>
* $smtp->Debugoutput = function($str, $level) {echo "debug level $level; message: $str";};
* </code>
* @type string|callable
* @var string|callable
*/
public $Debugoutput = 'echo';
......@@ -130,7 +130,7 @@ class SMTP
* Whether to use VERP.
* @link http://en.wikipedia.org/wiki/Variable_envelope_return_path
* @link http://www.postfix.org/VERP_README.html Info on VERP
* @type boolean
* @var boolean
*/
public $do_verp = false;
......@@ -139,26 +139,26 @@ class SMTP
* Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2
* This needs to be quite high to function correctly with hosts using greetdelay as an anti-spam measure.
* @link http://tools.ietf.org/html/rfc2821#section-4.5.3.2
* @type integer
* @var integer
*/
public $Timeout = 300;
/**
* How long to wait for commands to complete, in seconds.
* Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2
* @type integer
* @var integer
*/
public $Timelimit = 300;
/**
* The socket for the server connection.
* @type resource
* @var resource
*/
protected $smtp_conn;
/**
* Error information, if any, for the last SMTP command.
* @type array
* @var array
*/
protected $error = array(
'error' => '',
......@@ -170,7 +170,7 @@ class SMTP
/**
* The reply the server sent to us for HELO.
* If null, no HELO string has yet been received.
* @type string|null
* @var string|null
*/
protected $helo_rply = null;
......@@ -181,13 +181,13 @@ class SMTP
* represents the server name. In case of HELO it is the only element of the array.
* Other values can be boolean TRUE or an array containing extension options.
* If null, no HELO/EHLO string has yet been received.
* @type array|null
* @var array|null
*/
protected $server_caps = null;
/**
* The most recent reply received from the server.
* @type string
* @var string
*/
protected $last_reply = '';
......@@ -356,7 +356,7 @@ class SMTP
* @param string $authtype The auth type (PLAIN, LOGIN, NTLM, CRAM-MD5, XOAUTH2)
* @param string $realm The auth realm for NTLM
* @param string $workstation The auth workstation for NTLM
* @param null|OAuth $OAuth An optional OAuth instance (@see PHPMailerOAuth)
* @param null|OAuth $OAuth An optional OAuth instance (@see PHPMailerOAuth)
* @return bool True if successfully authenticated.* @access public
*/
public function authenticate(
......@@ -814,15 +814,15 @@ class SMTP
* Sets the TO argument to $toaddr.
* Returns true if the recipient was accepted false if it was rejected.
* Implements from rfc 821: RCPT <SP> TO:<forward-path> <CRLF>
* @param string $toaddr The address the message is being sent to
* @param string $address The address the message is being sent to
* @access public
* @return boolean
*/
public function recipient($toaddr)
public function recipient($address)
{
return $this->sendCommand(
'RCPT TO',
'RCPT TO:<' . $toaddr . '>',
'RCPT TO:<' . $address . '>',
array(250, 251)
);
}
......@@ -841,9 +841,9 @@ class SMTP
/**
* Send a command to an SMTP server and check its return code.
* @param string $command The command name - not sent to the server
* @param string $command The command name - not sent to the server
* @param string $commandstring The actual command to send
* @param integer|array $expect One or more expected integer success codes
* @param integer|array $expect One or more expected integer success codes
* @access protected
* @return boolean True on success.
*/
......@@ -853,6 +853,11 @@ class SMTP
$this->setError("Called $command without being connected");
return false;
}
//Reject line breaks in all commands
if (strpos($commandstring, "\n") !== false or strpos($commandstring, "\r") !== false) {
$this->setError("Command '$command' contained line breaks");
return false;
}
$this->client_send($commandstring . self::CRLF);
$this->last_reply = $this->get_lines();
......
<?php
/*
htmLawed 1.1.17, 11 March 2014
htmLawed 1.1.20, 9 June 2015
Copyright Santosh Patnaik
Dual licensed with LGPL 3 and GPL 2+
A PHP Labware internal utility; www.bioinformatics.org/phplabware/internal_utilities/htmLawed
......@@ -434,8 +434,8 @@ if(!empty($m[1])){
}
// open tag & attr
static $aN = array('abbr'=>array('td'=>1, 'th'=>1), 'accept-charset'=>array('form'=>1), 'accept'=>array('form'=>1, 'input'=>1), 'accesskey'=>array('a'=>1, 'area'=>1, 'button'=>1, 'input'=>1, 'label'=>1, 'legend'=>1, 'textarea'=>1), 'action'=>array('form'=>1), 'align'=>array('caption'=>1, 'embed'=>1, 'applet'=>1, 'iframe'=>1, 'img'=>1, 'input'=>1, 'object'=>1, 'legend'=>1, 'table'=>1, 'hr'=>1, 'div'=>1, 'h1'=>1, 'h2'=>1, 'h3'=>1, 'h4'=>1, 'h5'=>1, 'h6'=>1, 'p'=>1, 'col'=>1, 'colgroup'=>1, 'tbody'=>1, 'td'=>1, 'tfoot'=>1, 'th'=>1, 'thead'=>1, 'tr'=>1), 'alt'=>array('applet'=>1, 'area'=>1, 'img'=>1, 'input'=>1), 'archive'=>array('applet'=>1, 'object'=>1), 'axis'=>array('td'=>1, 'th'=>1), 'bgcolor'=>array('embed'=>1, 'table'=>1, 'tr'=>1, 'td'=>1, 'th'=>1), 'border'=>array('table'=>1, 'img'=>1, 'object'=>1), 'bordercolor'=>array('table'=>1, 'td'=>1, 'tr'=>1), 'cellpadding'=>array('table'=>1), 'cellspacing'=>array('table'=>1), 'char'=>array('col'=>1, 'colgroup'=>1, 'tbody'=>1, 'td'=>1, 'tfoot'=>1, 'th'=>1, 'thead'=>1, 'tr'=>1), 'charoff'=>array('col'=>1, 'colgroup'=>1, 'tbody'=>1, 'td'=>1, 'tfoot'=>1, 'th'=>1, 'thead'=>1, 'tr'=>1), 'charset'=>array('a'=>1, 'script'=>1), 'checked'=>array('input'=>1), 'cite'=>array('blockquote'=>1, 'q'=>1, 'del'=>1, 'ins'=>1), 'classid'=>array('object'=>1), 'clear'=>array('br'=>1), 'code'=>array('applet'=>1), 'codebase'=>array('object'=>1, 'applet'=>1), 'codetype'=>array('object'=>1), 'color'=>array('font'=>1), 'cols'=>array('textarea'=>1), 'colspan'=>array('td'=>1, 'th'=>1), 'compact'=>array('dir'=>1, 'dl'=>1, 'menu'=>1, 'ol'=>1, 'ul'=>1), 'coords'=>array('area'=>1, 'a'=>1), 'data'=>array('object'=>1), 'datetime'=>array('del'=>1, 'ins'=>1), 'declare'=>array('object'=>1), 'defer'=>array('script'=>1), 'dir'=>array('bdo'=>1), 'disabled'=>array('button'=>1, 'input'=>1, 'optgroup'=>1, 'option'=>1, 'select'=>1, 'textarea'=>1), 'enctype'=>array('form'=>1), 'face'=>array('font'=>1), 'flashvars'=>array('embed'=>1), 'for'=>array('label'=>1), 'frame'=>array('table'=>1), 'frameborder'=>array('iframe'=>1), 'headers'=>array('td'=>1, 'th'=>1), 'height'=>array('embed'=>1, 'iframe'=>1, 'td'=>1, 'th'=>1, 'img'=>1, 'object'=>1, 'applet'=>1), 'href'=>array('a'=>1, 'area'=>1), 'hreflang'=>array('a'=>1), 'hspace'=>array('applet'=>1, 'img'=>1, 'object'=>1), 'ismap'=>array('img'=>1, 'input'=>1), 'label'=>array('option'=>1, 'optgroup'=>1), 'language'=>array('script'=>1), 'longdesc'=>array('img'=>1, 'iframe'=>1), 'marginheight'=>array('iframe'=>1), 'marginwidth'=>array('iframe'=>1), 'maxlength'=>array('input'=>1), 'method'=>array('form'=>1), 'model'=>array('embed'=>1), 'multiple'=>array('select'=>1), 'name'=>array('button'=>1, 'embed'=>1, 'textarea'=>1, 'applet'=>1, 'select'=>1, 'form'=>1, 'iframe'=>1, 'img'=>1, 'a'=>1, 'input'=>1, 'object'=>1, 'map'=>1, 'param'=>1), 'nohref'=>array('area'=>1), 'noshade'=>array('hr'=>1), 'nowrap'=>array('td'=>1, 'th'=>1), 'object'=>array('applet'=>1), 'onblur'=>array('a'=>1, 'area'=>1, 'button'=>1, 'input'=>1, 'label'=>1, 'select'=>1, 'textarea'=>1), 'onchange'=>array('input'=>1, 'select'=>1, 'textarea'=>1), 'onfocus'=>array('a'=>1, 'area'=>1, 'button'=>1, 'input'=>1, 'label'=>1, 'select'=>1, 'textarea'=>1), 'onreset'=>array('form'=>1), 'onselect'=>array('input'=>1, 'textarea'=>1), 'onsubmit'=>array('form'=>1), 'pluginspage'=>array('embed'=>1), 'pluginurl'=>array('embed'=>1), 'prompt'=>array('isindex'=>1), 'readonly'=>array('textarea'=>1, 'input'=>1), 'rel'=>array('a'=>1), 'rev'=>array('a'=>1), 'rows'=>array('textarea'=>1), 'rowspan'=>array('td'=>1, 'th'=>1), 'rules'=>array('table'=>1), 'scope'=>array('td'=>1, 'th'=>1), 'scrolling'=>array('iframe'=>1), 'selected'=>array('option'=>1), 'shape'=>array('area'=>1, 'a'=>1), 'size'=>array('hr'=>1, 'font'=>1, 'input'=>1, 'select'=>1), 'span'=>array('col'=>1, 'colgroup'=>1), 'src'=>array('embed'=>1, 'script'=>1, 'input'=>1, 'iframe'=>1, 'img'=>1), 'standby'=>array('object'=>1), 'start'=>array('ol'=>1), 'summary'=>array('table'=>1), 'tabindex'=>array('a'=>1, 'area'=>1, 'button'=>1, 'input'=>1, 'object'=>1, 'select'=>1, 'textarea'=>1), 'target'=>array('a'=>1, 'area'=>1, 'form'=>1), 'type'=>array('a'=>1, 'embed'=>1, 'object'=>1, 'param'=>1, 'script'=>1, 'input'=>1, 'li'=>1, 'ol'=>1, 'ul'=>1, 'button'=>1), 'usemap'=>array('img'=>1, 'input'=>1, 'object'=>1), 'valign'=>array('col'=>1, 'colgroup'=>1, 'tbody'=>1, 'td'=>1, 'tfoot'=>1, 'th'=>1, 'thead'=>1, 'tr'=>1), 'value'=>array('input'=>1, 'option'=>1, 'param'=>1, 'button'=>1, 'li'=>1), 'valuetype'=>array('param'=>1), 'vspace'=>array('applet'=>1, 'img'=>1, 'object'=>1), 'width'=>array('embed'=>1, 'hr'=>1, 'iframe'=>1, 'img'=>1, 'object'=>1, 'table'=>1, 'td'=>1, 'th'=>1, 'applet'=>1, 'col'=>1, 'colgroup'=>1, 'pre'=>1), 'wmode'=>array('embed'=>1), 'xml:space'=>array('pre'=>1, 'script'=>1, 'style'=>1)); // Ele-specific
static $aNE = array('checked'=>1, 'compact'=>1, 'declare'=>1, 'defer'=>1, 'disabled'=>1, 'ismap'=>1, 'multiple'=>1, 'nohref'=>1, 'noresize'=>1, 'noshade'=>1, 'nowrap'=>1, 'readonly'=>1, 'selected'=>1); // Empty
static $aN = array('abbr'=>array('td'=>1, 'th'=>1), 'accept-charset'=>array('form'=>1), 'accept'=>array('form'=>1, 'input'=>1), 'accesskey'=>array('a'=>1, 'area'=>1, 'button'=>1, 'input'=>1, 'label'=>1, 'legend'=>1, 'textarea'=>1), 'action'=>array('form'=>1), 'align'=>array('caption'=>1, 'embed'=>1, 'applet'=>1, 'iframe'=>1, 'img'=>1, 'input'=>1, 'object'=>1, 'legend'=>1, 'table'=>1, 'hr'=>1, 'div'=>1, 'h1'=>1, 'h2'=>1, 'h3'=>1, 'h4'=>1, 'h5'=>1, 'h6'=>1, 'p'=>1, 'col'=>1, 'colgroup'=>1, 'tbody'=>1, 'td'=>1, 'tfoot'=>1, 'th'=>1, 'thead'=>1, 'tr'=>1), 'allowfullscreen'=>array('iframe'=>1), 'alt'=>array('applet'=>1, 'area'=>1, 'img'=>1, 'input'=>1), 'archive'=>array('applet'=>1, 'object'=>1), 'axis'=>array('td'=>1, 'th'=>1), 'bgcolor'=>array('embed'=>1, 'table'=>1, 'tr'=>1, 'td'=>1, 'th'=>1), 'border'=>array('table'=>1, 'img'=>1, 'object'=>1), 'bordercolor'=>array('table'=>1, 'td'=>1, 'tr'=>1), 'cellpadding'=>array('table'=>1), 'cellspacing'=>array('table'=>1), 'char'=>array('col'=>1, 'colgroup'=>1, 'tbody'=>1, 'td'=>1, 'tfoot'=>1, 'th'=>1, 'thead'=>1, 'tr'=>1), 'charoff'=>array('col'=>1, 'colgroup'=>1, 'tbody'=>1, 'td'=>1, 'tfoot'=>1, 'th'=>1, 'thead'=>1, 'tr'=>1), 'charset'=>array('a'=>1, 'script'=>1), 'checked'=>array('input'=>1), 'cite'=>array('blockquote'=>1, 'q'=>1, 'del'=>1, 'ins'=>1), 'classid'=>array('object'=>1), 'clear'=>array('br'=>1), 'code'=>array('applet'=>1), 'codebase'=>array('object'=>1, 'applet'=>1), 'codetype'=>array('object'=>1), 'color'=>array('font'=>1), 'cols'=>array('textarea'=>1), 'colspan'=>array('td'=>1, 'th'=>1), 'compact'=>array('dir'=>1, 'dl'=>1, 'menu'=>1, 'ol'=>1, 'ul'=>1), 'coords'=>array('area'=>1, 'a'=>1), 'data'=>array('object'=>1), 'datetime'=>array('del'=>1, 'ins'=>1), 'declare'=>array('object'=>1), 'defer'=>array('script'=>1), 'dir'=>array('bdo'=>1), 'disabled'=>array('button'=>1, 'input'=>1, 'optgroup'=>1, 'option'=>1, 'select'=>1, 'textarea'=>1), 'enctype'=>array('form'=>1), 'face'=>array('font'=>1), 'flashvars'=>array('embed'=>1), 'for'=>array('label'=>1), 'frame'=>array('table'=>1), 'frameborder'=>array('iframe'=>1), 'headers'=>array('td'=>1, 'th'=>1), 'height'=>array('embed'=>1, 'iframe'=>1, 'td'=>1, 'th'=>1, 'img'=>1, 'object'=>1, 'applet'=>1), 'href'=>array('a'=>1, 'area'=>1), 'hreflang'=>array('a'=>1), 'hspace'=>array('applet'=>1, 'img'=>1, 'object'=>1), 'ismap'=>array('img'=>1, 'input'=>1), 'label'=>array('option'=>1, 'optgroup'=>1), 'language'=>array('script'=>1), 'longdesc'=>array('img'=>1, 'iframe'=>1), 'marginheight'=>array('iframe'=>1), 'marginwidth'=>array('iframe'=>1), 'maxlength'=>array('input'=>1), 'method'=>array('form'=>1), 'model'=>array('embed'=>1), 'multiple'=>array('select'=>1), 'name'=>array('button'=>1, 'embed'=>1, 'textarea'=>1, 'applet'=>1, 'select'=>1, 'form'=>1, 'iframe'=>1, 'img'=>1, 'a'=>1, 'input'=>1, 'object'=>1, 'map'=>1, 'param'=>1), 'nohref'=>array('area'=>1), 'noshade'=>array('hr'=>1), 'nowrap'=>array('td'=>1, 'th'=>1), 'object'=>array('applet'=>1), 'onblur'=>array('a'=>1, 'area'=>1, 'button'=>1, 'input'=>1, 'label'=>1, 'select'=>1, 'textarea'=>1), 'onchange'=>array('input'=>1, 'select'=>1, 'textarea'=>1), 'onfocus'=>array('a'=>1, 'area'=>1, 'button'=>1, 'input'=>1, 'label'=>1, 'select'=>1, 'textarea'=>1), 'onreset'=>array('form'=>1), 'onselect'=>array('input'=>1, 'textarea'=>1), 'onsubmit'=>array('form'=>1), 'pluginspage'=>array('embed'=>1), 'pluginurl'=>array('embed'=>1), 'prompt'=>array('isindex'=>1), 'readonly'=>array('textarea'=>1, 'input'=>1), 'rel'=>array('a'=>1), 'rev'=>array('a'=>1), 'rows'=>array('textarea'=>1), 'rowspan'=>array('td'=>1, 'th'=>1), 'rules'=>array('table'=>1), 'scope'=>array('td'=>1, 'th'=>1), 'scrolling'=>array('iframe'=>1), 'selected'=>array('option'=>1), 'shape'=>array('area'=>1, 'a'=>1), 'size'=>array('hr'=>1, 'font'=>1, 'input'=>1, 'select'=>1), 'span'=>array('col'=>1, 'colgroup'=>1), 'src'=>array('embed'=>1, 'script'=>1, 'input'=>1, 'iframe'=>1, 'img'=>1), 'standby'=>array('object'=>1), 'start'=>array('ol'=>1), 'summary'=>array('table'=>1), 'tabindex'=>array('a'=>1, 'area'=>1, 'button'=>1, 'input'=>1, 'object'=>1, 'select'=>1, 'textarea'=>1), 'target'=>array('a'=>1, 'area'=>1, 'form'=>1), 'type'=>array('a'=>1, 'embed'=>1, 'object'=>1, 'param'=>1, 'script'=>1, 'input'=>1, 'li'=>1, 'ol'=>1, 'ul'=>1, 'button'=>1), 'usemap'=>array('img'=>1, 'input'=>1, 'object'=>1), 'valign'=>array('col'=>1, 'colgroup'=>1, 'tbody'=>1, 'td'=>1, 'tfoot'=>1, 'th'=>1, 'thead'=>1, 'tr'=>1), 'value'=>array('input'=>1, 'option'=>1, 'param'=>1, 'button'=>1, 'li'=>1), 'valuetype'=>array('param'=>1), 'vspace'=>array('applet'=>1, 'img'=>1, 'object'=>1), 'width'=>array('embed'=>1, 'hr'=>1, 'iframe'=>1, 'img'=>1, 'object'=>1, 'table'=>1, 'td'=>1, 'th'=>1, 'applet'=>1, 'col'=>1, 'colgroup'=>1, 'pre'=>1), 'wmode'=>array('embed'=>1), 'xml:space'=>array('pre'=>1, 'script'=>1, 'style'=>1)); // Ele-specific
static $aNE = array('allowfullscreen'=>1, 'checked'=>1, 'compact'=>1, 'declare'=>1, 'defer'=>1, 'disabled'=>1, 'ismap'=>1, 'multiple'=>1, 'nohref'=>1, 'noresize'=>1, 'noshade'=>1, 'nowrap'=>1, 'readonly'=>1, 'selected'=>1); // Empty
static $aNP = array('action'=>1, 'cite'=>1, 'classid'=>1, 'codebase'=>1, 'data'=>1, 'href'=>1, 'longdesc'=>1, 'model'=>1, 'pluginspage'=>1, 'pluginurl'=>1, 'usemap'=>1); // Need scheme check; excludes style, on* & src
static $aNU = array('class'=>array('param'=>1, 'script'=>1), 'dir'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'iframe'=>1, 'param'=>1, 'script'=>1), 'id'=>array('script'=>1), 'lang'=>array('applet'=>1, 'br'=>1, 'iframe'=>1, 'param'=>1, 'script'=>1), 'xml:lang'=>array('applet'=>1, 'br'=>1, 'iframe'=>1, 'param'=>1, 'script'=>1), 'onclick'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'ondblclick'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'onkeydown'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'onkeypress'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'onkeyup'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'onmousedown'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'onmousemove'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'onmouseout'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'onmouseover'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'onmouseup'=>array('applet'=>1, 'bdo'=>1, 'br'=>1, 'font'=>1, 'iframe'=>1, 'isindex'=>1, 'param'=>1, 'script'=>1), 'style'=>array('param'=>1, 'script'=>1), 'title'=>array('param'=>1, 'script'=>1)); // Univ & exceptions
......@@ -475,7 +475,7 @@ while(strlen($a)){
break; case 2: // Val
if(preg_match('`^((?:"[^"]*")|(?:\'[^\']*\')|(?:\s*[^\s"\']+))(.*)`', $a, $m)){
$a = ltrim($m[2]); $m = $m[1]; $w = 1; $mode = 0;
$aA[$nm] = trim(($m[0] == '"' or $m[0] == '\'') ? substr($m, 1, -1) : $m);
$aA[$nm] = trim(str_replace('<', '&lt;', ($m[0] == '"' or $m[0] == '\'') ? substr($m, 1, -1) : $m));
}
break;
}
......@@ -504,7 +504,7 @@ foreach($aA as $k=>$v){
$v = preg_replace_callback('`(url(?:\()(?: )*(?:\'|"|&(?:quot|apos);)?)(.+?)((?:\'|"|&(?:quot|apos);)?(?: )*(?:\)))`iS', 'hl_prot', $v);
$v = !$C['css_expression'] ? preg_replace('`expression`i', ' ', preg_replace('`\\\\\S|(/|(%2f))(\*|(%2a))`i', ' ', $v)) : $v;
}elseif(isset($aNP[$k]) or strpos($k, 'src') !== false or $k[0] == 'o'){
$v = str_replace("\xad", ' ', (strpos($v, '&') !== false ? str_replace(array('&#xad;', '&#173;', '&shy;'), ' ', $v) : $v));
$v = str_replace("­", ' ', (strpos($v, '&') !== false ? str_replace(array('&#xad;', '&#173;', '&shy;'), ' ', $v) : $v)); # double-quoted char is soft-hyphen; appears here as "­" or hyphen or something else depending on viewing software
$v = hl_prot($v, $k);
if($k == 'href'){ // X-spam
if($C['anti_mail_spam'] && strpos($v, 'mailto:') === 0){
......@@ -629,10 +629,10 @@ if($e == 'font'){
$a2 .= ' font-family: '. str_replace('"', '\'', trim($m[2])). ';';
}
if(preg_match('`color\s*=\s*(\'|")?(.+?)(\\1|\s|$)`i', $a, $m)){
$a2 .= ' color: '. trim($m[2]). ';';
$a2 .= ' color: '. str_replace('"', '\'', trim($m[2])). ';';
}
if(preg_match('`size\s*=\s*(\'|")?(.+?)(\\1|\s|$)`i', $a, $m) && isset($fs[($m = trim($m[2]))])){
$a2 .= ' font-size: '. $fs[$m]. ';';
$a2 .= ' font-size: '. str_replace('"', '\'', $fs[$m]). ';';
}
$e = 'span'; return ltrim($a2);
}
......@@ -698,7 +698,7 @@ return str_replace(array("\x01", "\x02", "\x03", "\x04", "\x05", "\x07"), array(
function hl_version(){
// rel
return '1.1.17';
return '1.1.20';
// eof
}
......@@ -720,4 +720,4 @@ function kses_hook($t, &$C, &$S){
// kses compat
return $t;
// eof
}
\ No newline at end of file
}
......@@ -56,7 +56,7 @@ class qa_facebook_login_page
if ($fb_userid) {
try {
$user=$facebook->api('/me?fields=email,name,verified,location,website,about,picture');
$user=$facebook->api('/me?fields=email,name,verified,location,website,about,picture.width(250)');
if (is_array($user))
qa_log_in_external_user('facebook', $fb_userid, array(
......
No preview for this file type
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>Copyright (C) 2014 by original authors @ fontello.com</metadata>
<metadata>Copyright (C) 2016 by original authors @ fontello.com</metadata>
<defs>
<font id="fontello" horiz-adv-x="1000" >
<font-face font-family="fontello" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
<missing-glyph horiz-adv-x="1000" />
<glyph glyph-name="link" unicode="&#xe800;" d="m9 600q0 67 47 113l82 82q47 46 114 46 67 0 114-47l114-116q47-46 47-113 0-69-49-117l49-49q48 49 116 49 67 0 114-47l116-116q47-47 47-114t-48-113l-82-81q-46-47-113-47-68 0-114 48l-115 115q-46 47-46 114 0 68 49 116l-49 49q-48-49-116-49-67 0-114 47l-116 116q-47 47-47 114z m107 0q0-22 16-38l116-116q15-15 38-15 23 0 40 17-2 2-11 11t-12 12-8 10-7 14-2 16q0 22 15 38t38 15q9 0 16-2t14-7 10-8 12-12 11-11q18 17 18 41 0 22-15 38l-115 115q-16 16-38 16-22 0-38-15l-82-82q-16-15-16-37z m392-393q0-23 16-38l115-116q15-15 38-15 22 0 38 15l82 81q15 16 15 37 0 23-15 38l-116 116q-16 16-38 16-24 0-40-18 1-1 10-10t12-12 9-11 7-14 2-15q0-23-16-38t-38-16q-8 0-15 2t-14 7-11 9-12 12-10 10q-19-17-19-40z" horiz-adv-x="928.6" />
<glyph glyph-name="chat" unicode="&#xe800;" d="m1179 385q0-126-79-233t-215-170-296-62q-122 0-234 39l2-3-357-107q44 59 71 126t31 106l4 38q-106 120-106 266 0 126 79 233t215 169 295 62 296-62 215-169 79-233z m-250 0q0 29-21 50t-51 21q-29 0-50-21t-21-50q0-30 21-51t50-21q30 0 51 21t21 51z m-250 0q0 29-21 50t-51 21q-29 0-50-21t-21-50q0-30 21-51t50-21q30 0 51 21t21 51z m-250 0q0 29-21 50t-51 21q-29 0-50-21t-21-50q0-30 21-51t50-21q30 0 51 21t21 51z" horiz-adv-x="1179" />
<glyph glyph-name="help" unicode="&#xe801;" d="m494 740q86-62 86-184 0-64-42-124-12-20-88-80l-46-30q-40-34-48-60-6-16-8-44 0-14-16-14l-128 0q-16 0-16 12 4 98 28 124 16 22 48 48t56 42l24 14q22 16 34 34 28 44 28 70 0 40-26 78-28 36-92 36-68 0-94-44-28-42-28-92l-166 0q6 162 114 232 70 42 166 42 130 0 214-60z m-216-636q44 0 73-30t27-74q-2-46-32-73t-74-25q-44 0-73 29t-27 75 32 73 74 25z" horiz-adv-x="580" />
<glyph glyph-name="comment" unicode="&#xe802;" d="m0 96l0 713 1000 0 0-713-473 0-320-205 0 205-207 0z" horiz-adv-x="1000" />
<glyph glyph-name="comment-alt" unicode="&#xe803;" d="m0 192l0 607 854 0 0-607-405 0-273-176 0 176-176 0z m348-112l119 77 129 0 9-6 170-112 0 118 149 0 0 433-31 0 0 76 107 0 0-586-148 0 0-179-59 37-221 142-224 0z" horiz-adv-x="1000" />
......@@ -25,34 +25,25 @@
<glyph glyph-name="money" unicode="&#xe810;" d="m238 378c13 16 35 21 65 24l0-85c-50 5-75 9-75 39 0 7 2 15 10 22z m107-241l0 91c59-5 78-9 78-35 0-30-24-49-78-56z m70 244c30-17 36-24 36-38l8-4 45 90-6 5c-7-5-10-7-14-7s-8 0-13 4c-61 23-90 35-126 35l0 17c0 9 5 15 20 19l0 9-79 0 0-9c14-4 17-11 17-19l0-15c-97-4-153-50-153-122 0-74 40-100 153-110l0-97c-78 8-117 38-117 64l-7 4-41-94 6-4c6 4 9 5 12 5 2 0 7 0 9-2 48-24 94-38 138-40l0-19c0-10-3-16-17-20l0-9 79 0 0 9c-15 4-20 9-20 20l0 19c96 5 159 54 159 126 0 70-53 106-149 115l-10 0 0 88c23-2 46-8 70-20z m41 181c117-50 198-165 198-300 0-181-146-328-326-328-182 0-328 147-328 328 0 135 81 250 198 300l-82 179c0 17 12 25 28 25l366 0c16 0 28-7 28-25z" horiz-adv-x="654" />
<glyph glyph-name="wallet" unicode="&#xe811;" d="m0 22l0 625q0 70 51 121t121 51l640 0q40 0 67-28t27-66l0-281q94-71 94-188t-94-187l0-47q0-70-51-121t-121-51l-562 0q-70 0-121 51t-51 121z m63 0q0-45 32-77t77-33l562 0q45 0 78 33t32 77l0 47-281 0q-65 0-111 46t-46 110 46 110 111 46l281 0 0 63q0 13-9 22t-23 9l-640 0q-63 0-109 39l0-492z m0 625q0-45 31-76l0 123q0 13 9 22t22 9l656 0q14 0 23-9t9-22l0-156q15 0 31-6l0 193q0 14-9 22t-23 9l-640 0q-45 0-77-32t-32-77z m62-98q23-11 47-11l609 0 0 31-656 0 0-20z m0 51l656 0 0 31-656 0 0-31z m0 62l656 0 0 32-656 0 0-32z m344-437q0-39 27-66t67-28l320 0q54 51 54 125 0 59-35 104l0-2q-4-8-7-14-20-25-51-25l-281 0q-40 0-67-28t-27-66z m31 0q0 25 19 44t44 19 43-19 19-44-19-44-43-18-44 18-19 44z" horiz-adv-x="1000" />
<glyph glyph-name="arrows-cw" unicode="&#xe812;" d="m0-7v250q0 14 11 25t25 11h250q14 0 25-11t10-25-10-25l-77-77q40-37 90-57t105-20q74 0 139 37t104 99q6 10 29 66 5 13 17 13h107q8 0 13-6t5-12q0-3 0-4-36-150-150-243t-267-93q-81 0-157 31t-136 88l-72-72q-11-11-25-11t-25 11-11 25z m10 446v4q36 150 151 243t268 93q81 0 158-31t137-88l72 72q11 11 25 11t26-11 10-25v-250q0-14-10-25t-26-11h-250q-14 0-25 11t-10 25 10 25l77 77q-82 77-194 77-75 0-140-37t-104-99q-6-10-29-66-5-13-17-13h-111q-7 0-13 6t-5 12z" horiz-adv-x="857.1" />
<glyph glyph-name="power" unicode="&#xe813;" d="m339 75q95 0 164 69t70 166q0 97-69 166-15 15-15 36t15 36 37 15 37-15q100-100 100-238 0-140-100-240-99-99-239-99-141 0-240 99t-99 240q0 140 99 238 15 15 37 15t37-15 15-36-15-36q-69-69-69-166 0-97 69-166t166-69z m0 291q-21 0-37 15t-16 36l0 261q0 22 16 37t37 15 36-15 15-37l0-261q0-21-15-36t-36-15z" horiz-adv-x="678" />
<glyph glyph-name="th-list" unicode="&#xe814;" d="m0-150l0 250 250 0 0-250-250 0z m0 375l0 250 250 0 0-250-250 0z m0 375l0 250 250 0 0-250-250 0z m391-750l0 250 609 0 0-250-609 0z m0 375l0 250 609 0 0-250-609 0z m0 375l0 250 609 0 0-250-609 0z" horiz-adv-x="1000" />
<glyph glyph-name="left-open-big" unicode="&#xe815;" d="m452-20q26-26 0-48-26-26-48 0l-392 394q-24 24 0 50l392 394q22 26 48 0 26-22 0-48l-358-372z" horiz-adv-x="465" />
<glyph glyph-name="right-open-big" unicode="&#xe816;" d="m13-20l358 370-358 372q-26 26 0 48 26 26 48 0l392-394q24-26 0-50l-392-394q-22-26-48 0-26 22 0 48z" horiz-adv-x="465" />
<glyph glyph-name="down-open-big" unicode="&#xe817;" d="m63 570l370-356 372 356q22 26 48 0 26-22 0-48l-396-392q-22-22-48 0l-396 392q-26 26 0 48 24 24 50 0z" horiz-adv-x="866" />
<glyph glyph-name="up-open-big" unicode="&#xe818;" d="m804 130l-372 358-370-358q-26-22-50 0-24 24 0 50l396 390q26 26 48 0l396-390q24-26 0-50-26-22-48 0z" horiz-adv-x="864" />
<glyph glyph-name="down-open-mini" unicode="&#xe819;" d="m405 470q22 26 48 0 26-22 0-48l-196-192q-22-22-48 0l-196 192q-26 26 0 48 24 24 50 0l170-156z" horiz-adv-x="466" />
<glyph glyph-name="up-open-mini" unicode="&#xe81a;" d="m62 230q-26-22-50 0-24 24 0 50l196 190q26 26 48 0l196-190q24-26 0-50-24-22-50 0l-170 158z" horiz-adv-x="464" />
<glyph glyph-name="right-open-mini" unicode="&#xe81b;" d="m13 180l158 170-158 172q-26 26 0 48 26 26 48 0l192-194q24-26 0-50l-192-194q-22-26-48 0-26 22 0 48z" horiz-adv-x="265" />
<glyph glyph-name="left-open-mini" unicode="&#xe81c;" d="m252 180q26-26 0-48-26-26-48 0l-192 194q-24 24 0 50l192 194q22 26 48 0 26-22 0-48l-156-172z" horiz-adv-x="265" />
<glyph glyph-name="rss" unicode="&#xe81d;" d="m0 730q314 0 537-223t223-537l-118 0q0 266-188 453t-454 187l0 120z m0-238q218 0 371-153t153-369l-118 0q0 166-119 285t-287 119l0 118z m114-296q46 0 80-33t34-81q0-46-34-79t-80-33-80 33-34 79q0 48 34 81t80 33z" horiz-adv-x="760" />
<glyph glyph-name="facebook" unicode="&#xe81e;" d="m0-150l0 1000 1000 0 0-1000-1000 0z m471 469l92 0 0-352 132 0 0 352 129 0 6 127-135 0 0 94q0 31 12 43t41 13l80 0 2 117q-59 6-88 6l-23 0q-31 0-57-10-99-39-99-154l0-109-92 0 0-127z" horiz-adv-x="1000" />
<glyph glyph-name="twitter" unicode="&#xe81f;" d="m749-25c0-34-13-64-37-88-25-25-54-37-89-37l-248 0c-103 0-192 36-265 110-73 73-110 161-110 264l0 501c0 35 12 65 37 89 24 24 54 36 89 36 34 0 64-12 88-37 25-24 37-54 37-88l0-181 353 0c32 0 60-12 83-35 22-22 34-49 34-81 0-32-12-59-34-82-23-23-51-34-82-34l-354 0 0-88c0-34 12-64 36-88 24-24 54-36 88-36l248 0c35 0 64-12 89-37 24-24 37-54 37-88" horiz-adv-x="749" />
<glyph glyph-name="twitter-bird" unicode="&#xe820;" d="m1231 732q-51-77-126-131 1-14 1-32 0-102-30-203-29-102-90-195-61-92-145-164-84-72-201-114-118-43-253-43-210 0-387 113 31-3 60-3 176 0 314 108-82 2-147 51-64 49-89 125 24-5 48-5 34 0 66 9-87 17-145 87-57 69-57 160l0 4q53-30 114-32-52 34-82 90-30 55-30 120 0 68 34 127 95-117 230-186 135-70 290-78-6 28-6 58 0 104 74 178 74 74 178 74 110 0 185-80 85 17 160 62-29-91-111-140 76 9 145 39z" horiz-adv-x="1231" />
<glyph glyph-name="googleplus" unicode="&#xe821;" d="m0-150l0 125q51 59 143 76 82 12 105 12 18 0 35-2 14-12 63-45t72-55q55-47 55-95 0-10-2-16l-471 0z m0 207l0 254q90-66 203-51-27-68 2-115 14-21 29-43l-50 0q-131-4-184-45z m0 617l0 176 1000 0 0-271-184 0 0 185-80 0 0-185-185 0 0-77 185 0 0-187 80 0 0 187 184 0 0-652-443 0q19 72-6 131-26 57-84 107-28 24-102 82-39 28-39 63 2 31 41 72 57 43 82 82 35 53 35 125 0 67-31 119-19 32-56 67l87 0 82 66-306 0q-74-2-145-24t-115-66z m59-60q13 58 70 86 25 11 55 13 45 0 80-27 68-57 91-154 20-78 2-129-23-67-74-80-78-22-133 15-64 51-86 141-15 68-5 135z" horiz-adv-x="1000" />
<glyph glyph-name="linkedin" unicode="&#xe822;" d="m0-150l0 1000 1000 0 0-1000-1000 0z m164 729q2-34 25-54t53-23l2 0q35 2 59 24t23 53q-2 33-25 53t-55 21q-35 0-58-22t-24-52z m8-569l144 0 0 434-144 0 0-434z m225 0l144 0 0 242q0 24 4 36 27 52 74 52 72-2 72-97l0-233 145 0 0 248q-2 98-47 149-47 47-119 49-53-2-86-26-21-15-43-47l0 61-144 0q1-18 1-70 0-90-1-364z" horiz-adv-x="1000" />
<glyph glyph-name="youtube" unicode="&#xe823;" d="m0 123q0 54 6 162 4 53 38 87t87 36q100 5 301 5t301-5q53-3 87-36t38-87q5-90 5-162t-5-162q-4-53-38-87t-87-36q-100-5-301-5t-301 5q-53 3-87 36t-38 87q-6 108-6 162z m67 141l61 0 0-326 59 0 0 326 61 0 0 55-181 0 0-55z m65 603l60 0 38-152 4 0 36 152 60 0-46-148q-23-73-23-75l0-158-59 0 0 151q-2 14-5 26t-9 26-9 25z m116-885q0-48 36-48 32 0 61 35l0-31 52 0 0 281-52 0 0-214q-21-21-31-21-14 0-14 19l0 216-52 0 0-237z m79 575l0 146q0 34 22 53t56 18q33 0 54-20t20-53l0-145q0-36-20-56t-56-21q-35 0-55 22t-21 56z m54-7q0-23 22-23 23 0 23 25l0 153q0 9-7 15t-16 6-15-5-7-15l0-156z m67-612l53 0 0 21q20-25 50-25 47 0 47 62l0 156q0 71-51 71-25 0-46-27l0 123-53 0 0-381z m53 53l0 176q11 11 22 11 22 0 22-28l0-148q0-24-19-24-14 0-25 13z m23 539l0 237 52 0 0-215q0-19 14-19 13 0 31 21l0 213 52 0 0-281-52 0 0 31q-29-35-61-35-36 0-36 48z m114-513q0-38 19-63t57-24q78 0 78 87l0 21-54 0q0-2 1-13t-1-17-2-14-7-12-14-3q-23 0-23 40l0 53 100 0 0 72q0 38-18 60t-57 22q-36 0-57-23t-22-59l0-127z m54 99l0 30q0 31 23 31t23-31l0-30-46 0z" horiz-adv-x="863" />
<glyph glyph-name="vimeo" unicode="&#xe824;" d="m0-150l0 1000 1000 0 0-1000-1000 0z m133 600q2-4 8-12t7-10q12-12 38-4 25 10 41 9t29-26q27-74 74-252 31-102 76-121 26-6 52 0t46 17q119 76 213 239 2 3 26 50t33 69 23 60 12 68-18 47q-53 41-108 27t-101-58-62-94q48 0 58-4 29-15 25-64-11-51-37-100t-58-54q-14 0-30 17-19 24-27 50t-13 71-6 55q0 2-5 31t-8 42-11 35-19 36-28 18q-66 10-156-74-37-33-74-65l0-3z" horiz-adv-x="1000" />
<glyph glyph-name="pinterest" unicode="&#xe825;" d="m0 491q0 63 27 125t76 115 130 86 178 33q159 0 261-98t102-231q0-171-86-282t-224-112q-45 0-84 21t-56 51l-40-158q-5-19-13-38t-17-38-19-34-19-30-17-24-13-16l-6-8q-3-4-8-3t-6 6q0 1-1 14t-3 27-3 38-1 44 3 48 7 48q11 47 74 313-8 16-13 39t-5 36l-1 15q0 64 33 107t78 42q37 0 58-24t20-62q0-23-8-56t-23-77-20-71q-10-45 18-78t73-33q79 0 131 90t51 216q0 97-63 159t-176 61q-126 0-204-81t-79-194q0-67 38-113 13-15 8-32-2-5-6-23t-6-23q-2-11-10-14t-18 0q-59 24-88 83t-30 136z" horiz-adv-x="774" />
<glyph glyph-name="facebook-1" unicode="&#xe826;" d="m0 313l0 191 154 0 0 96q0 104 68 177t163 73l153 0 0-191-153 0q-15 0-27-16t-12-41l0-98 192 0 0-191-192 0 0-463-192 0 0 463-154 0z" horiz-adv-x="538" />
<glyph glyph-name="vimeo-1" unicode="&#xe827;" d="m0 578q55 65 110 116t96 78 72 43 48 21l17 4q12 2 24 2 19 0 35-6 26-10 43-34t29-55 21-72 15-78 14-79 14-71q32-125 52-177t41-53q24 0 67 56t93 151q26 48 26 91 0 13-2 23-9 52-51 65-11 4-24 4-35 0-83-26 22 130 134 209 85 60 174 60 12 0 24-1 102-8 139-90 18-38 18-88 0-29-6-61-18-102-69-208t-113-187-133-155-123-118-91-68q-42-24-78-24t-70 21-56 48-38 57q-18 38-97 299t-97 280q-1 2-4 4t-13 5-24 0-37-14-50-33z" horiz-adv-x="1146" />
<glyph glyph-name="linkedin-1" unicode="&#xe828;" d="m0 730q0 50 35 83t91 32q55 0 89-32 35-33 35-86 0-48-34-80-35-33-92-33l-1 0q-55 0-89 33t-34 83z m13-875l0 668 222 0 0-668-222 0z m345 0l222 0 0 373q0 35 8 54 14 34 43 58t71 23q112 0 112-151l0-357 222 0 0 383q0 148-70 225t-185 76q-129 0-201-111l0-2-1 0 1 2 0 95-222 0q2-32 2-199t-2-469z" horiz-adv-x="1036" />
<glyph glyph-name="gplus" unicode="&#xe829;" d="m0 32q0 87 89 155t215 68l54 0q-42 40-42 86 0 29 16 58-10-1-29-1-104 0-170 65t-66 160q0 91 82 159t187 68l310 0-69-50-98 0q47-18 74-68t26-111q0-93-88-162-37-29-48-46t-11-42q0-19 27-48t54-49q61-43 85-88t23-113q0-90-82-157t-222-66q-133 0-225 50t-92 132z m112 33q0-69 59-118t145-48q119 0 173 44t53 117q0 19-4 32-3 11-7 21t-12 19-14 16-19 16-21 15-25 18-26 17q-39 12-77 12-90 1-157-47t-68-114z m66 559q11-79 61-136t109-58q59-2 94 52t25 133-59 134-110 57-95-51-25-131z m555-24l0 50 200 0 0 200 50 0 0-200 201 0 0-50-201 0 0-201-50 0 0 201-200 0z" horiz-adv-x="1184" />
<glyph glyph-name="github" unicode="&#xe82a;" d="m0 3q0-63 62-108t150-45 151 45 62 108q0 64-62 109t-151 45q-1 0-3 0t-3-1q-24 22-24 48t24 53q71 4 120 55t49 121q0 28-7 50 28 5 44 14l0 115q-48-32-109-32l-7 0q-46 31-101 31-75 0-128-52t-53-126q0-47 24-87t64-64q-28-36-28-74 0-36 26-75-46-21-73-55t-27-75z m121 432q0 33 22 57t50 23q30 0 51-23t21-57-21-56-51-24q-29 0-50 24t-22 56z m3-432q0 27 26 46t62 18 63-18 26-46q0-26-26-45t-63-19-62 19-26 45z m331 766q0 34 24 58t57 23 58-23 24-58-24-58-58-24-57 24-24 58z m19-647l0 479 134 0 0-479-134 0z m181 377l55 0 0-285q4-30 20-51t34-32 38-16 30-7l20 0q27 0 48 8 23 8 30 16l7 9 2 99q-42-13-65-13-5 0-9 1-23 3-27 16l-4 13q0 3-1 4l0 238 91 0 0 102-91 0 0 93-123 0 0-93-55 0 0-102z" horiz-adv-x="939" />
<glyph glyph-name="wordpress" unicode="&#xe82b;" d="m0 350q4 209 151 354t349 146q207-4 353-151t147-349q-4-207-151-353t-349-147q-209 4-353 151t-147 349z m35 0q2-193 140-328t325-137q193 4 328 141t137 324q-4 193-141 328t-324 137q-193-4-329-141t-136-324z m41-30q-8 108 33 200l205-553q-109 55-173 155-57 89-65 198z m69 264q62 90 157 140t198 52q168-4 287-111-47 1-70-40-4-25-6-39t7-35 14-33 18-31l18-30q33-62 7-144l-62-219-154 459q43 4 46 4 12 4 15 14t-7 15q-6 6-11 6l-94-8-70 0q-4 0-27 4t-37 2-17-13q-3-16 14-20 33-4 47-6l68-179-93-278-157 459q43 4 49 4 18 2 16 20-4 15-20 15-70-10-136-8z m234-642l129 367 133-359q-131-45-262-8z m334 39q6 19 21 62l120 346q15 49 23 111 2 28-2 49 76-162 33-312-51-172-195-256z" horiz-adv-x="1000" />
<glyph glyph-name="ok" unicode="&#xe82c;" d="m68 332q0 22 15 38l76 76q16 16 38 16t38-16l164-165 366 367q16 16 38 16t38-16l76-76q15-16 15-38t-15-38l-404-404-76-76q-16-15-38-15t-38 15l-76 76-202 202q-15 16-15 38z" horiz-adv-x="1000" />
<glyph glyph-name="ok-circled" unicode="&#xe82d;" d="m0 350q0 117 58 215t155 156 216 58 215-58 156-156 57-215-57-215-156-156-215-58-216 58-155 156-58 215z m141-11q0-15 10-25l202-202q10-10 25-10 15 0 25 10l303 303q11 10 11 25 0 16-11 26l-50 50q-11 11-25 11t-26-11l-227-227-126 126q-11 11-25 11t-26-11l-50-50q-10-10-10-26z" horiz-adv-x="857.1" />
<glyph glyph-name="reply" unicode="&#xe82e;" d="m0 493q0 14 11 25l285 286q11 10 25 10t26-10 10-25v-143h125q398 0 488-225 30-75 30-186 0-93-71-252-2-4-6-13t-7-17-8-12q-6-10-15-10-9 0-13 6t-5 14q0 5 1 15t2 13q3 38 3 69 0 56-10 101t-27 77-45 56-59 39-74 24-86 12-98 3h-125v-143q0-14-10-25t-26-11-25 11l-285 286q-11 10-11 25z" horiz-adv-x="1000" />
<glyph glyph-name="th-list" unicode="&#xe813;" d="m0-150l0 250 250 0 0-250-250 0z m0 375l0 250 250 0 0-250-250 0z m0 375l0 250 250 0 0-250-250 0z m391-750l0 250 609 0 0-250-609 0z m0 375l0 250 609 0 0-250-609 0z m0 375l0 250 609 0 0-250-609 0z" horiz-adv-x="1000" />
<glyph glyph-name="left-open-big" unicode="&#xe814;" d="m452-20q26-26 0-48-26-26-48 0l-392 394q-24 24 0 50l392 394q22 26 48 0 26-22 0-48l-358-372z" horiz-adv-x="465" />
<glyph glyph-name="right-open-big" unicode="&#xe815;" d="m13-20l358 370-358 372q-26 26 0 48 26 26 48 0l392-394q24-26 0-50l-392-394q-22-26-48 0-26 22 0 48z" horiz-adv-x="465" />
<glyph glyph-name="down-open-big" unicode="&#xe816;" d="m63 570l370-356 372 356q22 26 48 0 26-22 0-48l-396-392q-22-22-48 0l-396 392q-26 26 0 48 24 24 50 0z" horiz-adv-x="866" />
<glyph glyph-name="up-open-big" unicode="&#xe817;" d="m804 130l-372 358-370-358q-26-22-50 0-24 24 0 50l396 390q26 26 48 0l396-390q24-26 0-50-26-22-48 0z" horiz-adv-x="864" />
<glyph glyph-name="down-open-mini" unicode="&#xe818;" d="m405 470q22 26 48 0 26-22 0-48l-196-192q-22-22-48 0l-196 192q-26 26 0 48 24 24 50 0l170-156z" horiz-adv-x="466" />
<glyph glyph-name="up-open-mini" unicode="&#xe819;" d="m62 230q-26-22-50 0-24 24 0 50l196 190q26 26 48 0l196-190q24-26 0-50-24-22-50 0l-170 158z" horiz-adv-x="464" />
<glyph glyph-name="right-open-mini" unicode="&#xe81a;" d="m13 180l158 170-158 172q-26 26 0 48 26 26 48 0l192-194q24-26 0-50l-192-194q-22-26-48 0-26 22 0 48z" horiz-adv-x="265" />
<glyph glyph-name="left-open-mini" unicode="&#xe81b;" d="m252 180q26-26 0-48-26-26-48 0l-192 194q-24 24 0 50l192 194q22 26 48 0 26-22 0-48l-156-172z" horiz-adv-x="265" />
<glyph glyph-name="rss" unicode="&#xe81c;" d="m0 730q314 0 537-223t223-537l-118 0q0 266-188 453t-454 187l0 120z m0-238q218 0 371-153t153-369l-118 0q0 166-119 285t-287 119l0 118z m114-296q46 0 80-33t34-81q0-46-34-79t-80-33-80 33-34 79q0 48 34 81t80 33z" horiz-adv-x="760" />
<glyph glyph-name="facebook" unicode="&#xe81d;" d="m0-150l0 1000 1000 0 0-1000-1000 0z m471 469l92 0 0-352 132 0 0 352 129 0 6 127-135 0 0 94q0 31 12 43t41 13l80 0 2 117q-59 6-88 6l-23 0q-31 0-57-10-99-39-99-154l0-109-92 0 0-127z" horiz-adv-x="1000" />
<glyph glyph-name="twitter" unicode="&#xe81e;" d="m749-25c0-34-13-64-37-88-25-25-54-37-89-37l-248 0c-103 0-192 36-265 110-73 73-110 161-110 264l0 501c0 35 12 65 37 89 24 24 54 36 89 36 34 0 64-12 88-37 25-24 37-54 37-88l0-181 353 0c32 0 60-12 83-35 22-22 34-49 34-81 0-32-12-59-34-82-23-23-51-34-82-34l-354 0 0-88c0-34 12-64 36-88 24-24 54-36 88-36l248 0c35 0 64-12 89-37 24-24 37-54 37-88" horiz-adv-x="749" />
<glyph glyph-name="twitter-bird" unicode="&#xe81f;" d="m1231 732q-51-77-126-131 1-14 1-32 0-102-30-203-29-102-90-195-61-92-145-164-84-72-201-114-118-43-253-43-210 0-387 113 31-3 60-3 176 0 314 108-82 2-147 51-64 49-89 125 24-5 48-5 34 0 66 9-87 17-145 87-57 69-57 160l0 4q53-30 114-32-52 34-82 90-30 55-30 120 0 68 34 127 95-117 230-186 135-70 290-78-6 28-6 58 0 104 74 178 74 74 178 74 110 0 185-80 85 17 160 62-29-91-111-140 76 9 145 39z" horiz-adv-x="1231" />
<glyph glyph-name="googleplus" unicode="&#xe820;" d="m0-150l0 125q51 59 143 76 82 12 105 12 18 0 35-2 14-12 63-45t72-55q55-47 55-95 0-10-2-16l-471 0z m0 207l0 254q90-66 203-51-27-68 2-115 14-21 29-43l-50 0q-131-4-184-45z m0 617l0 176 1000 0 0-271-184 0 0 185-80 0 0-185-185 0 0-77 185 0 0-187 80 0 0 187 184 0 0-652-443 0q19 72-6 131-26 57-84 107-28 24-102 82-39 28-39 63 2 31 41 72 57 43 82 82 35 53 35 125 0 67-31 119-19 32-56 67l87 0 82 66-306 0q-74-2-145-24t-115-66z m59-60q13 58 70 86 25 11 55 13 45 0 80-27 68-57 91-154 20-78 2-129-23-67-74-80-78-22-133 15-64 51-86 141-15 68-5 135z" horiz-adv-x="1000" />
<glyph glyph-name="ok" unicode="&#xe821;" d="m68 332q0 22 15 38l76 76q16 16 38 16t38-16l164-165 366 367q16 16 38 16t38-16l76-76q15-16 15-38t-15-38l-404-404-76-76q-16-15-38-15t-38 15l-76 76-202 202q-15 16-15 38z" horiz-adv-x="1000" />
<glyph glyph-name="ok-circled" unicode="&#xe822;" d="m0 350q0 117 58 215t155 156 216 58 215-58 156-156 57-215-57-215-156-156-215-58-216 58-155 156-58 215z m141-11q0-15 10-25l202-202q10-10 25-10 15 0 25 10l303 303q11 10 11 25 0 16-11 26l-50 50q-11 11-25 11t-26-11l-227-227-126 126q-11 11-25 11t-26-11l-50-50q-10-10-10-26z" horiz-adv-x="857.1" />
<glyph glyph-name="reply" unicode="&#xe823;" d="m0 493q0 14 11 25l285 286q11 10 25 10t26-10 10-25v-143h125q398 0 488-225 30-75 30-186 0-93-71-252-2-4-6-13t-7-17-8-12q-6-10-15-10-9 0-13 6t-5 14q0 5 1 15t2 13q3 38 3 69 0 56-10 101t-27 77-45 56-59 39-74 24-86 12-98 3h-125v-143q0-14-10-25t-26-11-25 11l-285 286q-11 10-11 25z" horiz-adv-x="1000" />
<glyph glyph-name="power" unicode="&#xe824;" d="m339 75q95 0 164 69t70 166q0 97-69 166-15 15-15 36t15 36 37 15 37-15q100-100 100-238 0-140-100-240-99-99-239-99-141 0-240 99t-99 240q0 140 99 238 15 15 37 15t37-15 15-36-15-36q-69-69-69-166 0-97 69-166t166-69z m0 291q-21 0-37 15t-16 36l0 261q0 22 16 37t37 15 36-15 15-37l0-261q0-21-15-36t-36-15z" horiz-adv-x="678" />
<glyph glyph-name="link" unicode="&#xe825;" d="m9 600q0 67 47 113l82 82q47 46 114 46 67 0 114-47l114-116q47-46 47-113 0-69-49-117l49-49q48 49 116 49 67 0 114-47l116-116q47-47 47-114t-48-113l-82-81q-46-47-113-47-68 0-114 48l-115 115q-46 47-46 114 0 68 49 116l-49 49q-48-49-116-49-67 0-114 47l-116 116q-47 47-47 114z m107 0q0-22 16-38l116-116q15-15 38-15 23 0 40 17-2 2-11 11t-12 12-8 10-7 14-2 16q0 22 15 38t38 15q9 0 16-2t14-7 10-8 12-12 11-11q18 17 18 41 0 22-15 38l-115 115q-16 16-38 16-22 0-38-15l-82-82q-16-15-16-37z m392-393q0-23 16-38l115-116q15-15 38-15 22 0 38 15l82 81q15 16 15 37 0 23-15 38l-116 116q-16 16-38 16-24 0-40-18 1-1 10-10t12-12 9-11 7-14 2-15q0-23-16-38t-38-16q-8 0-15 2t-14 7-11 9-12 12-10 10q-19-17-19-40z" horiz-adv-x="928.6" />
</font>
</defs>
</svg>
\ No newline at end of file
No preview for this file type
No preview for this file type
......@@ -22,6 +22,7 @@
*zoom: 1;
}
.qa-main:after, .qa-main-wrapper:after, .qa-body-wrapper:after, .qa-sidepanel:after,
.clearfix:after, .qa-q-item-clear:after,
.qa-nav-main-list:after, .qa-nav-sub:after,
.qa-page-links:after, .qa-page-links-list:after,
......@@ -38,15 +39,16 @@
clear: both;
}
/*------[ web fonts ]------*/
/*------[ icon font ]------*/
@font-face {
font-family: "fontello";
src: url("fonts/fontello.eot?2559038") format("embedded-opentype"),
url("fonts/fontello.eot?2559038#iefix") format("embedded-opentype"),
url("fonts/fontello.woff?2559038") format("woff"),
url("fonts/fontello.ttf?2559038") format("truetype"),
url("fonts/fontello.svg?2559038#fontello") format("svg");
src: url("fonts/fontello.eot?70015067") format("embedded-opentype"),
url("fonts/fontello.eot?70015067#iefix") format("embedded-opentype"),
url("fonts/fontello2.woff?70015067") format("woff"),
url("fonts/fontello.ttf?70015067") format("truetype"),
url("fonts/fontello.svg?70015067#fontello") format("svg");
font-weight: normal;
font-style: normal;
}
/*------[ base css ]------*/
......@@ -111,8 +113,8 @@ h1 {
padding: 8px 52px 8px 20px;
background: #3498db;
color: #fff;
font-size: 1.5em;
line-height: 1.5em;
font-size: 1.4em;
line-height: 1.35em;
}
h1 a {
color: #fff;
......@@ -175,7 +177,6 @@ b, strong {
small {
font-size: 0.75em;
line-height: 2em;
}
table {
......@@ -190,16 +191,15 @@ th, td {
pre {
background-color: #e0e4e5;
border-left: 11px solid #3498db;
margin: 1.7em 0 1.7em 0.3em;
border-left: 8px solid #3498db;
margin: 1em 0;
overflow: auto;
padding: 0.1em 0.5em 0.3em 0.7em;
padding: 0.4em 0.8em;
width: 98%;
font-size: 0.82em;
}
pre code {
background-color: #d6dadb;
font-size: 0.875em;
line-height: 1.71429em;
}
code, samp, kbd {
......@@ -218,7 +218,6 @@ blockquote {
blockquote p {
margin: 0;
font-size: 1em;
line-height: 1.5em;
font-style: italic;
color: #7f8c8d;
}
......@@ -436,7 +435,6 @@ blockquote p {
#qam-topbar {
font-size: 0.875em;
line-height: 1.71429em;
}
#qam-topbar.fixed {
position: fixed;
......@@ -649,6 +647,7 @@ blockquote p {
.qa-nav-sub {
background-color: #e0e4e5;
text-align: center;
font-size: 12px;
}
.qa-nav-sub-list {
margin: 0;
......@@ -657,10 +656,6 @@ blockquote p {
}
@media (max-width: 979px) {
.qa-nav-sub {
font-size: 10px;
}
.qa-nav-sub-list {
*zoom: 1;
}
......@@ -675,7 +670,6 @@ blockquote p {
.qa-nav-sub-item {
width: 33.33%;
float: left;
display: block;
box-shadow: -1px -1px 0 0 #cfd9db inset;
}
.qa-nav-sub-item:nth-child(3) {
......@@ -684,18 +678,17 @@ blockquote p {
}
@media (min-width: 980px) {
.qa-nav-sub {
font-size: 12px;
font-size: 13px;
padding: 0 6px;
}
.qa-nav-sub-item {
display: inline-block;
margin: 0 5px 0 0;
}
}
.qa-nav-sub-link, .qa-nav-sub-link:visited, .qa-nav-sub-link:hover {
display: block;
padding: 0 4px;
padding: 2px 10px 4px;
color: #000;
}
.qa-nav-sub-link.qa-nav-sub-selected, .qa-nav-sub-link:visited.qa-nav-sub-selected, .qa-nav-sub-link:hover.qa-nav-sub-selected {
......@@ -858,7 +851,7 @@ blockquote p {
}
.qa-nav-user-logout:before {
content: '\e813';
content: '\e824';
font-family: "fontello";
display: inline-block;
width: 1em;
......@@ -881,14 +874,12 @@ blockquote p {
/*------[ qa content parts ]------*/
.qa-main, .qa-main-wrapper {
overflow: hidden;
*zoom: 1;
}
.qa-body-wrapper {
margin: 10px auto;
padding: 0 10px;
overflow: hidden;
*zoom: 1;
}
......@@ -1024,6 +1015,16 @@ blockquote p {
display: none;
}
}
@media (min-width: 241px) and (max-width: 799px) {
.qa-q-item-stats {
width: 60px;
}
}
@media (min-width: 800px) {
.qa-q-item-stats {
width: 133px;
}
}
.qa-voting {
background-color: #ecf0f1;
......@@ -1250,7 +1251,7 @@ blockquote p {
.qa-q-item-title {
font-weight: bold;
font-size: 1.125em;
line-height: 1.46667em;
line-height: 1.35em;
display: block;
}
.qa-q-item-title a {
......@@ -1301,7 +1302,6 @@ blockquote p {
display: inline-block;
vertical-align: middle;
font-size: 12px;
line-height: 20px;
}
.qa-q-item-meta .qa-category-link.qa-cat-favorited {
position: relative;
......@@ -1857,6 +1857,7 @@ input[type="submit"], button {
}
.qa-form-tall-button, .qa-form-wide-button, .qa-form-basic-button {
-webkit-appearance: none;
padding: 10px 15px;
border: 0;
font-size: 14px;
......@@ -2188,6 +2189,7 @@ input[type="submit"], button {
/*------[ q-view ]------*/
.qa-form-light-button {
-webkit-appearance: none;
display: block;
float: right;
margin: 0 0 0 5px;
......@@ -2309,6 +2311,7 @@ input[type="submit"], button {
width: 100%;
height: auto;
margin: 6px 0 -4px;
word-break: break-word;
}
.qa-view-count-data {
......@@ -2344,9 +2347,7 @@ input[type="submit"], button {
}
.qa-q-view-avatar {
position: absolute;
top: 20px;
right: 20px;
float: right;
}
.qa-q-view-meta {
......@@ -2356,8 +2357,6 @@ input[type="submit"], button {
@media (max-width: 979px) {
.qa-q-view-meta {
clear: left;
font-size: 0.875em;
line-height: 1.71429em;
}
.qa-q-view-main {
width: 100%;
......@@ -2367,7 +2366,7 @@ input[type="submit"], button {
.qa-q-view-main {
float: left;
margin: 0 0 0 20px;
width: 81%;
width: 86%;
}
}
......@@ -2511,9 +2510,7 @@ input[type="submit"], button {
}
.qa-a-item-avatar {
position: absolute;
top: 20px;
right: 20px;
float: right;
}
.qa-a-item-meta {
......@@ -2555,7 +2552,7 @@ input[type="submit"], button {
.qa-a-item-main {
float: left;
margin: 0 0 0 20px;
width: 81%;
width: 86%;
}
.qa-a-selection {
......@@ -2784,7 +2781,6 @@ input[type="submit"], button {
width: 25%;
padding: 0;
float: right;
overflow: hidden;
*zoom: 1;
}
}
......@@ -2952,7 +2948,7 @@ input[type="submit"], button {
background: #f1c40f;
}
.qa-activity-count-item:nth-child(3):before {
content: '\e803';
content: '\e800';
}
.qa-activity-count-item:nth-child(4) {
background: #e67e22;
......@@ -3044,7 +3040,7 @@ input[type="submit"], button {
.qa-feed-link:before {
font-family: "fontello";
font-size: 20px;
content: '\e81d';
content: '\e81c';
display: inline-block;
float: left;
margin-right: 8px;
......@@ -3435,209 +3431,6 @@ input[type="submit"], button {
transform: scale(1);
}
}
/*------[ icons ]------*/
[class^="icon-"]:before, [class*=" icon-"]:before {
font-family: "fontello";
font-style: normal;
font-weight: normal;
display: inline-block;
text-decoration: inherit;
width: 1em;
margin-right: .2em;
text-align: center;
font-variant: normal;
text-transform: none;
line-height: 1em;
margin-left: .2em;
}
.icon-link:before {
content: '\e800';
}
.icon-help:before {
content: '\e801';
}
.icon-comment:before {
content: '\e802';
}
.icon-comment-alt:before {
content: '\e803';
}
.icon-chart-line:before {
content: '\e804';
}
.icon-coffee:before {
content: '\e805';
}
.icon-tag:before {
content: '\e806';
}
.icon-tags:before {
content: '\e807';
}
.icon-spread:before {
content: '\e808';
}
.icon-group:before {
content: '\e809';
}
.icon-wrench:before {
content: '\e80a';
}
.icon-article:before {
content: '\e80b';
}
.icon-docs:before {
content: '\e80c';
}
.icon-infinity:before {
content: '\e80d';
}
.icon-user:before {
content: '\e80e';
}
.icon-key:before {
content: '\e80f';
}
.icon-money:before {
content: '\e810';
}
.icon-wallet:before {
content: '\e811';
}
.icon-arrows-cw:before {
content: '\e812';
}
.icon-power:before {
content: '\e813';
}
.icon-th-list:before {
content: '\e814';
}
.icon-left-open-big:before {
content: '\e815';
}
.icon-right-open-big:before {
content: '\e816';
}
.icon-down-open-big:before {
content: '\e817';
}
.icon-up-open-big:before {
content: '\e818';
}
.icon-down-open-mini:before {
content: '\e819';
}
.icon-up-open-mini:before {
content: '\e81a';
}
.icon-right-open-mini:before {
content: '\e81b';
}
.icon-left-open-mini:before {
content: '\e81c';
}
.icon-rss:before {
content: '\e81d';
}
.icon-facebook:before {
content: '\e81e';
}
.icon-twitter:before {
content: '\e81f';
}
.icon-twitter-bird:before {
content: '\e820';
}
.icon-googleplus:before {
content: '\e821';
}
.icon-linkedin:before {
content: '\e822';
}
.icon-youtube:before {
content: '\e823';
}
.icon-vimeo:before {
content: '\e824';
}
.icon-pinterest:before {
content: '\e825';
}
.icon-facebook-1:before {
content: '\e826';
}
.icon-vimeo-1:before {
content: '\e827';
}
.icon-linkedin-1:before {
content: '\e828';
}
.icon-gplus:before {
content: '\e829';
}
.icon-github:before {
content: '\e82a';
}
.icon-wordpress:before {
content: '\e82b';
}
.icon-ok:before {
content: '\e82c';
}
.icon-ok-circled:before {
content: '\e82d';
}
.icon-reply:before {
content: '\e82e';
}
@-webkit-keyframes answer-highlight {
0% { background-color: #ffffaa; }
......@@ -3656,3 +3449,64 @@ input[type="submit"], button {
0% { background-color: #ffffaa; }
100% { background-color: #f4f4f4; }
}
/*------[ icons ]------*/
[class^="icon-"]:before, [class*=" icon-"]:before {
font-family: "fontello";
font-style: normal;
font-weight: normal;
speak: none;
display: inline-block;
text-decoration: inherit;
width: 1em;
margin-right: .2em;
text-align: center;
font-variant: normal;
text-transform: none;
line-height: 1em;
margin-left: .2em;
/* Font smoothing. That was taken from TWBS */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-chat:before { content: '\e800'; }
.icon-help:before { content: '\e801'; }
.icon-comment:before { content: '\e802'; }
.icon-comment-alt:before { content: '\e803'; }
.icon-chart-line:before { content: '\e804'; }
.icon-coffee:before { content: '\e805'; }
.icon-tag:before { content: '\e806'; }
.icon-tags:before { content: '\e807'; }
.icon-spread:before { content: '\e808'; }
.icon-group:before { content: '\e809'; }
.icon-wrench:before { content: '\e80a'; }
.icon-article:before { content: '\e80b'; }
.icon-docs:before { content: '\e80c'; }
.icon-infinity:before { content: '\e80d'; }
.icon-user:before { content: '\e80e'; }
.icon-key:before { content: '\e80f'; }
.icon-money:before { content: '\e810'; }
.icon-wallet:before { content: '\e811'; }
.icon-arrows-cw:before { content: '\e812'; }
.icon-th-list:before { content: '\e813'; }
.icon-left-open-big:before { content: '\e814'; }
.icon-right-open-big:before { content: '\e815'; }
.icon-down-open-big:before { content: '\e816'; }
.icon-up-open-big:before { content: '\e817'; }
.icon-down-open-mini:before { content: '\e818'; }
.icon-up-open-mini:before { content: '\e819'; }
.icon-right-open-mini:before { content: '\e81a'; }
.icon-left-open-mini:before { content: '\e81b'; }
.icon-rss:before { content: '\e81c'; }
.icon-facebook:before { content: '\e81d'; }
.icon-twitter:before { content: '\e81e'; }
.icon-twitter-bird:before { content: '\e81f'; }
.icon-googleplus:before { content: '\e820'; }
.icon-ok:before { content: '\e821'; }
.icon-ok-circled:before { content: '\e822'; }
.icon-reply:before { content: '\e823'; }
.icon-power:before { content: '\e824'; }
.icon-link:before { content: '\e825'; }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment