@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | function boincuser_user($op, &$edit, &$account, $category = NULL) { |
217 | 217 | // Handle BOINC integration for users with UID > 1 (skip anonymous and admin) |
218 | 218 | if ($account->uid > 1) { |
219 | - switch($op) { |
|
219 | + switch ($op) { |
|
220 | 220 | case 'load': |
221 | 221 | // User loading; insert BOINC data into the user object |
222 | 222 | $drupal_user = db_fetch_object(db_query(" |
@@ -244,11 +244,11 @@ discard block |
||
244 | 244 | )); |
245 | 245 | $account->boincuser_name = $boinc_user->name; |
246 | 246 | $account->boincuser_account_key = $boinc_user->authenticator; |
247 | - $account->boincuser_weak_auth = md5($boinc_user->authenticator . $boinc_user->passwd_hash); |
|
247 | + $account->boincuser_weak_auth = md5($boinc_user->authenticator.$boinc_user->passwd_hash); |
|
248 | 248 | $account->boincuser_total_credit = round($boinc_user->total_credit); |
249 | 249 | $account->boincuser_expavg_credit = round($boinc_user->expavg_credit); |
250 | 250 | $account->boincuser_expavg_time = round($boinc_user->expavg_time); |
251 | - $account->boincuser_cpid = md5($boinc_user->cross_project_id . $account->mail); |
|
251 | + $account->boincuser_cpid = md5($boinc_user->cross_project_id.$account->mail); |
|
252 | 252 | $account->boincuser_default_pref_set = $boinc_user->venue; |
253 | 253 | $account->boincteam_id = $boinc_user->teamid; |
254 | 254 | db_set_active('default'); |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | // In Drupal 7, these operation cases will all exist as their own hooks, |
446 | 446 | // so let's approximate that here so that this function can simply be removed |
447 | 447 | // upon migration to 7 |
448 | - switch($op) { |
|
448 | + switch ($op) { |
|
449 | 449 | case 'update': |
450 | 450 | boincuser_node_update($node); |
451 | 451 | } |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | * is updated (forward compatible to Drupal 7) |
457 | 457 | */ |
458 | 458 | function boincuser_node_update($node) { |
459 | - switch($node->type) { |
|
459 | + switch ($node->type) { |
|
460 | 460 | case 'profile': |
461 | 461 | // Update the BOINC database directly |
462 | 462 | $account = user_load($node->uid); |
@@ -576,7 +576,7 @@ discard block |
||
576 | 576 | } |
577 | 577 | |
578 | 578 | $form['cancel'] = array( |
579 | - '#value' => '<li class="tab">' . l(bts('Cancel'), $cancel_dest) . '</li>', |
|
579 | + '#value' => '<li class="tab">'.l(bts('Cancel'), $cancel_dest).'</li>', |
|
580 | 580 | '#weight' => 1004, |
581 | 581 | ); |
582 | 582 | $form['form control tabs suffix'] = array( |
@@ -609,7 +609,7 @@ discard block |
||
609 | 609 | $form['buttons']['preview_changes']['#suffix'] = '</li>'; |
610 | 610 | $form['buttons']['preview_changes']['#weight'] = 1004; |
611 | 611 | $form['buttons']['cancel'] = array( |
612 | - '#value' => '<li class="tab">' . l(bts('Cancel'), "node/{$form['nid']['#value']}") . '</li>', |
|
612 | + '#value' => '<li class="tab">'.l(bts('Cancel'), "node/{$form['nid']['#value']}").'</li>', |
|
613 | 613 | '#weight' => 1005, |
614 | 614 | ); |
615 | 615 | $form['buttons']['delete']['#prefix'] = '<li class="tab">'; |
@@ -641,7 +641,7 @@ discard block |
||
641 | 641 | $form['actions']['submit']['#suffix'] = '</li>'; |
642 | 642 | $form['actions']['submit']['#weight'] = 1002; |
643 | 643 | $form['actions']['cancel'] = array( |
644 | - '#value' => '<li class="tab">' . l(bts('Cancel'), "node/{$form['nid']['#value']}") . '</li>', |
|
644 | + '#value' => '<li class="tab">'.l(bts('Cancel'), "node/{$form['nid']['#value']}").'</li>', |
|
645 | 645 | '#weight' => 1005, |
646 | 646 | ); |
647 | 647 | $form['actions']['form control tabs suffix'] = array( |
@@ -668,7 +668,7 @@ discard block |
||
668 | 668 | $form['privatemsg']['preview']['#suffix'] = '</li>'; |
669 | 669 | $form['privatemsg']['preview']['#weight'] = 1003; |
670 | 670 | $form['privatemsg']['cancel'] = array( |
671 | - '#value' => '<li class="tab">' . l(bts('Cancel'), $_GET['q']) . '</li>', |
|
671 | + '#value' => '<li class="tab">'.l(bts('Cancel'), $_GET['q']).'</li>', |
|
672 | 672 | '#weight' => 1004, |
673 | 673 | ); |
674 | 674 | $form['privatemsg']['form control tabs suffix'] = array( |
@@ -776,36 +776,36 @@ discard block |
||
776 | 776 | $form['account']['boincuser_id'] = array( |
777 | 777 | '#value' => ' |
778 | 778 | <div class="form-item"> |
779 | - <label>' . bts('BOINC user ID') . '</label> |
|
780 | - <span>' . $account->boincuser_id . '</span> |
|
779 | + <label>' . bts('BOINC user ID').'</label> |
|
780 | + <span>' . $account->boincuser_id.'</span> |
|
781 | 781 | </div>', |
782 | 782 | ); |
783 | 783 | $form['account']['user_id'] = array( |
784 | 784 | '#value' => ' |
785 | 785 | <div class="form-item"> |
786 | - <label>' . bts('Drupal user ID') . '</label> |
|
787 | - <span>' . $account->uid . '</span> |
|
786 | + <label>' . bts('Drupal user ID').'</label> |
|
787 | + <span>' . $account->uid.'</span> |
|
788 | 788 | </div>', |
789 | 789 | ); |
790 | 790 | $form['account']['account_key'] = array( |
791 | 791 | '#value' => ' |
792 | 792 | <div class="form-item"> |
793 | - <label>' . bts('Account key') . '</label> |
|
794 | - <span>' . $account->boincuser_account_key . '</span> |
|
793 | + <label>' . bts('Account key').'</label> |
|
794 | + <span>' . $account->boincuser_account_key.'</span> |
|
795 | 795 | </div>', |
796 | 796 | ); |
797 | 797 | $form['account']['weak_account_key'] = array( |
798 | 798 | '#value' => ' |
799 | 799 | <div class="form-item"> |
800 | - <label>' . bts('Weak account key') . '</label> |
|
801 | - <span>' . "{$account->boincuser_id}_{$account->boincuser_weak_auth}" . '</span> |
|
800 | + <label>' . bts('Weak account key').'</label> |
|
801 | + <span>' . "{$account->boincuser_id}_{$account->boincuser_weak_auth}".'</span> |
|
802 | 802 | </div>', |
803 | 803 | ); |
804 | 804 | $form['account']['cpid'] = array( |
805 | 805 | '#value' => ' |
806 | 806 | <div class="form-item"> |
807 | - <label>' . bts('Cross-project ID') . '</label> |
|
808 | - <span>' . $account->boincuser_cpid . '</span> |
|
807 | + <label>' . bts('Cross-project ID').'</label> |
|
808 | + <span>' . $account->boincuser_cpid.'</span> |
|
809 | 809 | </div>', |
810 | 810 | ); |
811 | 811 | |
@@ -828,7 +828,7 @@ discard block |
||
828 | 828 | $form['delete']['#weight'] = 1003; |
829 | 829 | } |
830 | 830 | $form['cancel'] = array( |
831 | - '#value' => '<li class="tab">' . l(bts('Cancel'), $_GET['q']) . '</li>', |
|
831 | + '#value' => '<li class="tab">'.l(bts('Cancel'), $_GET['q']).'</li>', |
|
832 | 832 | '#weight' => 1004, |
833 | 833 | ); |
834 | 834 | $form['form control tabs suffix'] = array( |
@@ -911,7 +911,7 @@ discard block |
||
911 | 911 | $form['buttons']['preview_changes']['#suffix'] = '</li>'; |
912 | 912 | $form['buttons']['preview_changes']['#weight'] = 1004; |
913 | 913 | $form['buttons']['cancel'] = array( |
914 | - '#value' => '<li class="tab">' . l(bts('Cancel'), $_GET['q']) . '</li>', |
|
914 | + '#value' => '<li class="tab">'.l(bts('Cancel'), $_GET['q']).'</li>', |
|
915 | 915 | '#weight' => 1005, |
916 | 916 | ); |
917 | 917 | $form['buttons']['delete']['#prefix'] = '<li class="tab">'; |
@@ -966,7 +966,7 @@ discard block |
||
966 | 966 | // Set name temporarily to dummy value to beat validation |
967 | 967 | $form['name'] = array( |
968 | 968 | '#type' => 'hidden', |
969 | - '#value' => rand() . '.' . time() |
|
969 | + '#value' => rand().'.'.time() |
|
970 | 970 | ); |
971 | 971 | |
972 | 972 | if (module_exists('captcha')) { |
@@ -1016,7 +1016,7 @@ discard block |
||
1016 | 1016 | $form['buttons']['submit']['#suffix'] = '</li>'; |
1017 | 1017 | $form['buttons']['submit']['#weight'] = 1002; |
1018 | 1018 | $form['buttons']['cancel'] = array( |
1019 | - '#value' => '<li class="tab">' . l(bts('Cancel'), 'user/login') . '</li>', |
|
1019 | + '#value' => '<li class="tab">'.l(bts('Cancel'), 'user/login').'</li>', |
|
1020 | 1020 | '#weight' => 1005, |
1021 | 1021 | ); |
1022 | 1022 | $form['buttons']['form control tabs suffix'] = array( |
@@ -1098,7 +1098,7 @@ discard block |
||
1098 | 1098 | */ |
1099 | 1099 | function boincuser_token_list($type = 'all') { |
1100 | 1100 | if ($type == 'user' || $type == 'all') { |
1101 | - $tokens['user']['display-name'] = t("The user's name that should be displayed"); |
|
1101 | + $tokens['user']['display-name'] = t("The user's name that should be displayed"); |
|
1102 | 1102 | return $tokens; |
1103 | 1103 | } |
1104 | 1104 | } |
@@ -1108,9 +1108,9 @@ discard block |
||
1108 | 1108 | */ |
1109 | 1109 | function boincuser_views_pre_execute(&$view) { |
1110 | 1110 | $account_id = $view->args[0]; |
1111 | - if ($view->name=="user_activity") { |
|
1111 | + if ($view->name == "user_activity") { |
|
1112 | 1112 | // Run the following custom query for the user_activity view |
1113 | - $view->build_info['query']= " |
|
1113 | + $view->build_info['query'] = " |
|
1114 | 1114 | SELECT node_revisions.vid AS vid, |
1115 | 1115 | node.nid AS node_nid, |
1116 | 1116 | node.uid AS users_node_uid, |
@@ -1205,27 +1205,27 @@ discard block |
||
1205 | 1205 | $output = '<div class="join">'; |
1206 | 1206 | switch ($type) { |
1207 | 1207 | case 'boinc': |
1208 | - $output .= '<p>' . bts("If you're already running BOINC, select <i>Add |
|
1209 | - Project</i>.") . '</p>'; |
|
1208 | + $output .= '<p>'.bts("If you're already running BOINC, select <i>Add |
|
1209 | + Project</i>.").'</p>'; |
|
1210 | 1210 | if ($registration_enabled) { |
1211 | - $output .= '<p>' . bts("If you're running a command-line or pre-5.0 version |
|
1211 | + $output .= '<p>'.bts("If you're running a command-line or pre-5.0 version |
|
1212 | 1212 | of BOINC, !create_an_account first.", array('!create_an_account' => |
1213 | - l(bts('create an account'), 'user/registration'))) . '</p>'; |
|
1213 | + l(bts('create an account'), 'user/registration'))).'</p>'; |
|
1214 | 1214 | } |
1215 | 1215 | else { |
1216 | - $output .= '<p>' . bts("If you're running a command-line version of BOINC, |
|
1216 | + $output .= '<p>'.bts("If you're running a command-line version of BOINC, |
|
1217 | 1217 | first use the BOINC Manager software (elsewhere if necessary) to create an |
1218 | 1218 | an account at this project, then use that account to connect with the |
1219 | - command-line version.") . '</p>'; |
|
1220 | - $output .= '<p>' . bts("If you're running a pre-5.0 version of BOINC, please |
|
1219 | + command-line version.").'</p>'; |
|
1220 | + $output .= '<p>'.bts("If you're running a pre-5.0 version of BOINC, please |
|
1221 | 1221 | upgrade to a more recent version to create an account |
1222 | - at this project.") . '</p>'; |
|
1222 | + at this project.").'</p>'; |
|
1223 | 1223 | } |
1224 | 1224 | break; |
1225 | 1225 | case 'new': |
1226 | 1226 | default: |
1227 | 1227 | $output .= '<ol>'; |
1228 | - $output .= ' <li>' . bts('Download the desktop software'); |
|
1228 | + $output .= ' <li>'.bts('Download the desktop software'); |
|
1229 | 1229 | $output .= ' <p>'; |
1230 | 1230 | $output .= ' <a class="button" href="http://boinc.berkeley.edu/download.php">Download</a>'; |
1231 | 1231 | $output .= ' </p>'; |
@@ -1235,10 +1235,10 @@ discard block |
||
1235 | 1235 | //$output .= ' <a href="files/boinc_i686-pc-linux-gnu.sh" class="platform linux">Linux</a>'; |
1236 | 1236 | //$output .= ' </p>'; |
1237 | 1237 | $output .= ' </li>'; |
1238 | - $output .= ' <li>' . bts('Run the installer') . '</li>'; |
|
1239 | - $output .= ' <li>' . bts('When prompted enter @siteurl', array( |
|
1240 | - '@siteurl' => $base_url)) . '</li>'; |
|
1241 | - $output .= '</ol>'; |
|
1238 | + $output .= ' <li>'.bts('Run the installer').'</li>'; |
|
1239 | + $output .= ' <li>'.bts('When prompted enter @siteurl', array( |
|
1240 | + '@siteurl' => $base_url)).'</li>'; |
|
1241 | + $output .= '</ol>'; |
|
1242 | 1242 | } |
1243 | 1243 | $output .= '</div>'; |
1244 | 1244 | return $output; |
@@ -1251,7 +1251,7 @@ discard block |
||
1251 | 1251 | global $user; |
1252 | 1252 | $site_name = variable_get('site_name', ''); |
1253 | 1253 | // get the front page message from database; this is set in the admin interface under BOINC Other |
1254 | - $site_message = variable_get('boinc_other_frontpage',''); |
|
1254 | + $site_message = variable_get('boinc_other_frontpage', ''); |
|
1255 | 1255 | |
1256 | 1256 | // Determine the user of the day |
1257 | 1257 | $current_uotd = db_fetch_object(db_query(" |
@@ -1273,30 +1273,30 @@ discard block |
||
1273 | 1273 | $output .= ($user->uid) ? bts('Welcome back!') : ($site_name ? bts('What is @this_project?', array('@this_project' => $site_name)) : bts('Welcome!')); |
1274 | 1274 | $output .= '</h2>'; |
1275 | 1275 | $output .= '<div class="boinc-overview balance-height-front">'; |
1276 | - $output .= ' <div>' . bts($site_message, array(), NULL, "project:front page") . ' ' . l(bts('Learn more'), 'about') . '</div>'; |
|
1276 | + $output .= ' <div>'.bts($site_message, array(), NULL, "project:front page").' '.l(bts('Learn more'), 'about').'</div>'; |
|
1277 | 1277 | if ($user->uid) { |
1278 | - $output .= ' <div>' . l(bts('View account'), 'dashboard', array('attributes' => array('class' => 'join button'))) . '</div>'; |
|
1278 | + $output .= ' <div>'.l(bts('View account'), 'dashboard', array('attributes' => array('class' => 'join button'))).'</div>'; |
|
1279 | 1279 | } |
1280 | 1280 | else { |
1281 | - $output .= ' <div>' . l(bts('Join now'), 'join', array('attributes' => array('class' => 'join button'))) . '</div>'; |
|
1281 | + $output .= ' <div>'.l(bts('Join now'), 'join', array('attributes' => array('class' => 'join button'))).'</div>'; |
|
1282 | 1282 | } |
1283 | 1283 | $output .= '</div>'; |
1284 | 1284 | $output .= '<div class="boinc-overview-details">'; |
1285 | 1285 | $output .= ' <div class="detail-container">'; |
1286 | - $output .= ' <a class="user-of-the-day" href="account/' . $uotd->uid . '">'; |
|
1286 | + $output .= ' <a class="user-of-the-day" href="account/'.$uotd->uid.'">'; |
|
1287 | 1287 | $output .= ' <div class="picture">'; |
1288 | 1288 | $output .= theme('imagefield_image', $uotd_image['image'], $uotd_image['alt'], |
1289 | 1289 | $uotd_image['alt'], array(), FALSE); |
1290 | 1290 | $output .= ' </div>'; |
1291 | - $output .= ' <div class="text">' . bts('User of the day') . '</div>'; |
|
1292 | - $output .= ' <div class="detail">' . $uotd->boincuser_name . '</div>'; |
|
1291 | + $output .= ' <div class="text">'.bts('User of the day').'</div>'; |
|
1292 | + $output .= ' <div class="detail">'.$uotd->boincuser_name.'</div>'; |
|
1293 | 1293 | $output .= ' </a>'; |
1294 | 1294 | $output .= ' <div class="volunteers">'; |
1295 | - $output .= ' <div class="text">' . bts('Over 500,000 volunteers and counting.') . '</div>'; |
|
1295 | + $output .= ' <div class="text">'.bts('Over 500,000 volunteers and counting.').'</div>'; |
|
1296 | 1296 | $output .= ' <div class="platforms">'; |
1297 | - $output .= ' <div class="detail platform windows">' . bts('Windows') . '</div>'; |
|
1298 | - $output .= ' <div class="detail platform mac">' . bts('Mac') . '</div>'; |
|
1299 | - $output .= ' <div class="detail platform linux">' . bts('Linux') . '</div>'; |
|
1297 | + $output .= ' <div class="detail platform windows">'.bts('Windows').'</div>'; |
|
1298 | + $output .= ' <div class="detail platform mac">'.bts('Mac').'</div>'; |
|
1299 | + $output .= ' <div class="detail platform linux">'.bts('Linux').'</div>'; |
|
1300 | 1300 | $output .= ' </div>'; |
1301 | 1301 | $output .= ' </div>'; |
1302 | 1302 | $output .= ' </div>'; |
@@ -1488,7 +1488,7 @@ discard block |
||
1488 | 1488 | global $base_url; |
1489 | 1489 | global $base_path; |
1490 | 1490 | $site_name = variable_get('site_name', bts('project')); |
1491 | - $site_url = $base_url . $base_path; |
|
1491 | + $site_url = $base_url.$base_path; |
|
1492 | 1492 | $moderator = user_load($user->uid); |
1493 | 1493 | $profile->moderate = 0; |
1494 | 1494 | $profile->status = 0; |
@@ -1549,7 +1549,7 @@ discard block |
||
1549 | 1549 | global $base_url; |
1550 | 1550 | global $base_path; |
1551 | 1551 | $site_name = variable_get('site_name', bts('project')); |
1552 | - $site_url = $base_url . $base_path; |
|
1552 | + $site_url = $base_url.$base_path; |
|
1553 | 1553 | $moderator = user_load($user->uid); |
1554 | 1554 | $settings = array( |
1555 | 1555 | 'from' => '', |
@@ -1652,25 +1652,25 @@ discard block |
||
1652 | 1652 | if (!$projects) return bts('no projects...'); |
1653 | 1653 | |
1654 | 1654 | $output = ''; |
1655 | - $output .= '<table class="user-projects">' . "\n"; |
|
1656 | - $output .= '<thead>' . "\n"; |
|
1657 | - $output .= ' <tr>' . "\n"; |
|
1658 | - $output .= ' <th>' . bts('Name') . '</th>' . "\n"; |
|
1659 | - $output .= ' <th class="numeric">' . bts('Avg credit') . '</th>' . "\n"; |
|
1660 | - $output .= ' <th class="numeric">' . bts('Total credit') . '</th>' . "\n"; |
|
1661 | - $output .= ' </tr>' . "\n"; |
|
1662 | - $output .= '</thead>' . "\n"; |
|
1663 | - $output .= '<tbody>' . "\n"; |
|
1655 | + $output .= '<table class="user-projects">'."\n"; |
|
1656 | + $output .= '<thead>'."\n"; |
|
1657 | + $output .= ' <tr>'."\n"; |
|
1658 | + $output .= ' <th>'.bts('Name').'</th>'."\n"; |
|
1659 | + $output .= ' <th class="numeric">'.bts('Avg credit').'</th>'."\n"; |
|
1660 | + $output .= ' <th class="numeric">'.bts('Total credit').'</th>'."\n"; |
|
1661 | + $output .= ' </tr>'."\n"; |
|
1662 | + $output .= '</thead>'."\n"; |
|
1663 | + $output .= '<tbody>'."\n"; |
|
1664 | 1664 | foreach ($projects AS $project) { |
1665 | - $url = rtrim($project->url, '/') . '/show_user.php?userid=' . $project->id; |
|
1666 | - $output .= ' <tr>' . "\n"; |
|
1667 | - $output .= ' <td>' . l($project->name, $url) . '</td>' . "\n"; |
|
1668 | - $output .= ' <td class="numeric">' . boincwork_format_stats((float) $project->expavg_credit) . '</td>' . "\n"; |
|
1669 | - $output .= ' <td class="numeric">' . boincwork_format_stats((float) $project->total_credit) . '</td>' . "\n"; |
|
1670 | - $output .= ' </tr>' . "\n"; |
|
1665 | + $url = rtrim($project->url, '/').'/show_user.php?userid='.$project->id; |
|
1666 | + $output .= ' <tr>'."\n"; |
|
1667 | + $output .= ' <td>'.l($project->name, $url).'</td>'."\n"; |
|
1668 | + $output .= ' <td class="numeric">'.boincwork_format_stats((float)$project->expavg_credit).'</td>'."\n"; |
|
1669 | + $output .= ' <td class="numeric">'.boincwork_format_stats((float)$project->total_credit).'</td>'."\n"; |
|
1670 | + $output .= ' </tr>'."\n"; |
|
1671 | 1671 | } |
1672 | - $output .= '</tbody>' . "\n"; |
|
1673 | - $output .= '</table>' . "\n"; |
|
1672 | + $output .= '</tbody>'."\n"; |
|
1673 | + $output .= '</table>'."\n"; |
|
1674 | 1674 | $more_link = ($account) ? "user/{$account->uid}/stats" : 'account/stats'; |
1675 | 1675 | //$output .= "<div class=\"more-link\"><a href=\"{$more_link}\">More stats</a></div>" . "\n"; |
1676 | 1676 | return $output; |
@@ -1690,8 +1690,8 @@ discard block |
||
1690 | 1690 | 'cpid' => $cpid |
1691 | 1691 | ); |
1692 | 1692 | $args = array(); |
1693 | - foreach ($get as $arg => $value) $args[] = "{$arg}=" . rawurlencode($value); |
|
1694 | - $query = '?' . implode('&', $args); |
|
1693 | + foreach ($get as $arg => $value) $args[] = "{$arg}=".rawurlencode($value); |
|
1694 | + $query = '?'.implode('&', $args); |
|
1695 | 1695 | |
1696 | 1696 | // Load XML from RPC |
1697 | 1697 | $target_url = "http://{$stats_server}/{$stats_rpc}{$query}"; |
@@ -1763,12 +1763,12 @@ discard block |
||
1763 | 1763 | $output .= '<ul class="tab-list">'; |
1764 | 1764 | $count = 0; |
1765 | 1765 | foreach ($links as $key => $link) { |
1766 | - $output .= '<li class="' . (($count == 0) ? 'first primary ' : '') . 'tab">'; |
|
1766 | + $output .= '<li class="'.(($count == 0) ? 'first primary ' : '').'tab">'; |
|
1767 | 1767 | $output .= l($link['title'], $link['href'], array('query' => drupal_get_destination())); |
1768 | 1768 | $output .= '</li>'; |
1769 | 1769 | $count++; |
1770 | 1770 | } |
1771 | - $output .= '<li class="' . (($count) ? '' : 'first ') . 'last tab">' . flag_create_link('abuse_user', $account->uid) . '</li>'; |
|
1771 | + $output .= '<li class="'.(($count) ? '' : 'first ').'last tab">'.flag_create_link('abuse_user', $account->uid).'</li>'; |
|
1772 | 1772 | $output .= '</ul>'; |
1773 | 1773 | } |
1774 | 1774 | return $output; |
@@ -1809,7 +1809,7 @@ discard block |
||
1809 | 1809 | function boincuser_apachesolr_index_documents_alter(array &$documents, $entity, $entity_type, $env_id) { |
1810 | 1810 | |
1811 | 1811 | foreach ($documents as $document) { |
1812 | - if ( $document->entity_type=='node' AND $document->bundle=='profile' ) { |
|
1812 | + if ($document->entity_type == 'node' AND $document->bundle == 'profile') { |
|
1813 | 1813 | // Node information. |
1814 | 1814 | $nid = $document->entity_id; |
1815 | 1815 | $node = node_load($nid); |
@@ -274,7 +274,7 @@ |
||
274 | 274 | function boincuser_views_handlers() { |
275 | 275 | return array( |
276 | 276 | 'info' => array( |
277 | - 'path' => drupal_get_path('module', 'boincuser') . '/views', |
|
277 | + 'path' => drupal_get_path('module', 'boincuser').'/views', |
|
278 | 278 | ), |
279 | 279 | 'handlers' => array( |
280 | 280 | 'views_handler_argument_boincuser_id' => array( |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | // Call our custom authentication function to check for an existing BOINC user |
36 | 36 | if (!boincuser_login_authenticate($form_state['values'])) { |
37 | 37 | // Authentication failed; set an error accordingly |
38 | - form_set_error('name', bts('Sorry, unrecognized email address or password.') . ' ' . l(bts('Have you forgotten your password?'), 'user/password')); |
|
38 | + form_set_error('name', bts('Sorry, unrecognized email address or password.').' '.l(bts('Have you forgotten your password?'), 'user/password')); |
|
39 | 39 | } |
40 | 40 | } |
41 | 41 | |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | } else { |
80 | 80 | // Create a Drupal user from the BOINC user |
81 | 81 | if ($user = boincuser_register_make_drupal_user($boinc_user)) { |
82 | - watchdog('user', 'New external user: %email using module %module.', array('%email' => $email_addr, '%module' => $module), WATCHDOG_NOTICE, l(t('edit'), 'user/'. $user->uid .'/edit')); |
|
82 | + watchdog('user', 'New external user: %email using module %module.', array('%email' => $email_addr, '%module' => $module), WATCHDOG_NOTICE, l(t('edit'), 'user/'.$user->uid.'/edit')); |
|
83 | 83 | } |
84 | 84 | } |
85 | 85 | } |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | unset($_SESSION['reset_pass']); |
362 | 362 | } |
363 | 363 | else { |
364 | - $given_hash = md5($edit['current_pass'] . $account->mail); |
|
364 | + $given_hash = md5($edit['current_pass'].$account->mail); |
|
365 | 365 | if (!$edit['current_pass']) { |
366 | 366 | form_set_error('current_pass', bts('Authentication is required when changing E-mail address or setting new password.')); |
367 | 367 | } |
@@ -420,29 +420,29 @@ discard block |
||
420 | 420 | $project_domain = $headers['Host']; |
421 | 421 | $form['heading'] = array( |
422 | 422 | '#type' => 'markup', |
423 | - '#value' => '<h3>' . bts("If you forgot your account's email address, or you can't receive email there:") . '</h3>' |
|
423 | + '#value' => '<h3>'.bts("If you forgot your account's email address, or you can't receive email there:").'</h3>' |
|
424 | 424 | ); |
425 | 425 | $form['instructions'] = array( |
426 | 426 | '#type' => 'markup', |
427 | - '#value' => '' . |
|
428 | - '<p>' . bts("If you have run BOINC under the account, you can still access it. Here's how:") . |
|
429 | - ' <ul>' . |
|
430 | - ' <li>' . bts('Go to the BOINC data directory on your computer (see !boinc_wiki for help finding this).', array('!boinc_wiki' => l(bts('BOINC documentation'), 'http://boinc.berkeley.edu/wiki/BOINC_Data_directory'))) . '</li>' . |
|
431 | - ' <li>' . bts('Find your account file for this project; it will have a name like %file (where the project URL is %url).', array('%file' => "account_{$project_domain}.xml", '%url' => "http://{$project_domain}")) . '</li>' . |
|
432 | - ' <li>' . bts("Open the file in a text editor like Notepad. You'll see something like:") . |
|
433 | - ' <pre>' . |
|
434 | - '<account>' . "\n" . |
|
435 | - " <master_url>http://{$project_domain}/</master_url>" . "\n" . |
|
436 | - ' <authenticator>8b8496fdd26df7dc0423ecd43c09a56b</authenticator>' . "\n" . |
|
437 | - " <project_name>{$project_name}</project_name>" . "\n" . |
|
438 | - ' ...' . "\n" . |
|
439 | - '</account>' . |
|
440 | - ' </pre>' . |
|
441 | - ' </li>' . |
|
442 | - ' <li>' . bts('Select and Copy the string between <authenticator> and </authenticator> (%auth in the above example).', array('%auth' => '8b8496fdd26df7dc0423ecd43c09a56b')) . '</li>' . |
|
443 | - ' <li>' . bts('Paste the string into the field below, and click OK.') . '</li>' . |
|
444 | - ' <li>' . bts('You will now be logged in to your account; update the email and password of your account.') . '</li>' . |
|
445 | - ' </ul>' . |
|
427 | + '#value' => ''. |
|
428 | + '<p>'.bts("If you have run BOINC under the account, you can still access it. Here's how:"). |
|
429 | + ' <ul>'. |
|
430 | + ' <li>'.bts('Go to the BOINC data directory on your computer (see !boinc_wiki for help finding this).', array('!boinc_wiki' => l(bts('BOINC documentation'), 'http://boinc.berkeley.edu/wiki/BOINC_Data_directory'))).'</li>'. |
|
431 | + ' <li>'.bts('Find your account file for this project; it will have a name like %file (where the project URL is %url).', array('%file' => "account_{$project_domain}.xml", '%url' => "http://{$project_domain}")).'</li>'. |
|
432 | + ' <li>'.bts("Open the file in a text editor like Notepad. You'll see something like:"). |
|
433 | + ' <pre>'. |
|
434 | + '<account>'."\n". |
|
435 | + " <master_url>http://{$project_domain}/</master_url>"."\n". |
|
436 | + ' <authenticator>8b8496fdd26df7dc0423ecd43c09a56b</authenticator>'."\n". |
|
437 | + " <project_name>{$project_name}</project_name>"."\n". |
|
438 | + ' ...'."\n". |
|
439 | + '</account>'. |
|
440 | + ' </pre>'. |
|
441 | + ' </li>'. |
|
442 | + ' <li>'.bts('Select and Copy the string between <authenticator> and </authenticator> (%auth in the above example).', array('%auth' => '8b8496fdd26df7dc0423ecd43c09a56b')).'</li>'. |
|
443 | + ' <li>'.bts('Paste the string into the field below, and click OK.').'</li>'. |
|
444 | + ' <li>'.bts('You will now be logged in to your account; update the email and password of your account.').'</li>'. |
|
445 | + ' </ul>'. |
|
446 | 446 | '</p>' |
447 | 447 | ); |
448 | 448 | $form['authenticator'] = array( |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | '#weight' => 1002, |
468 | 468 | ); |
469 | 469 | $form['form control tabs'] = array( |
470 | - '#value' => '<li class="tab">' . l(bts('Cancel'), 'user/password') . '</li>', |
|
470 | + '#value' => '<li class="tab">'.l(bts('Cancel'), 'user/password').'</li>', |
|
471 | 471 | '#weight' => 1003, |
472 | 472 | ); |
473 | 473 | $form['form control tabs suffix'] = array( |
@@ -530,7 +530,7 @@ discard block |
||
530 | 530 | '#weight' => 1002, |
531 | 531 | ); |
532 | 532 | $form['form control tabs'] = array( |
533 | - '#value' => '<li class="tab">' . l(bts('Cancel'), "account/{$uid}") . '</li>', |
|
533 | + '#value' => '<li class="tab">'.l(bts('Cancel'), "account/{$uid}").'</li>', |
|
534 | 534 | '#weight' => 1003, |
535 | 535 | ); |
536 | 536 | $form['form control tabs suffix'] = array( |
@@ -581,7 +581,7 @@ discard block |
||
581 | 581 | '#weight' => 1002, |
582 | 582 | ); |
583 | 583 | $form['form control tabs'] = array( |
584 | - '#value' => '<li class="tab">' . l(bts('Cancel'), "account/{$uid}") . '</li>', |
|
584 | + '#value' => '<li class="tab">'.l(bts('Cancel'), "account/{$uid}").'</li>', |
|
585 | 585 | '#weight' => 1003, |
586 | 586 | ); |
587 | 587 | $form['form control tabs suffix'] = array( |
@@ -598,7 +598,7 @@ discard block |
||
598 | 598 | $uid = $form_state['storage']['ban_user_uid']; |
599 | 599 | $reason = $form_state['values']['reason']; |
600 | 600 | $duration = $form_state['values']['duration']; |
601 | - if ($duration) $duration = $duration * 24*60*60; |
|
601 | + if ($duration) $duration = $duration*24*60*60; |
|
602 | 602 | boincuser_moderate_user_ban($uid, $reason, $duration); |
603 | 603 | } |
604 | 604 |
@@ -154,8 +154,8 @@ discard block |
||
154 | 154 | WHERE n.type = 'profile' |
155 | 155 | AND n.status = 1 |
156 | 156 | AND n.moderate = 0 |
157 | - " . ($never_been_picked ? " AND bu.uotd_time = 0 " : '') . " |
|
158 | - " . ($active_users ? " AND bu.boinc_id IN ({$active_users}) " : '') . " |
|
157 | + " . ($never_been_picked ? " AND bu.uotd_time = 0 " : '')." |
|
158 | + " . ($active_users ? " AND bu.boinc_id IN ({$active_users}) " : '')." |
|
159 | 159 | ORDER BY RAND() |
160 | 160 | LIMIT 1" |
161 | 161 | )); |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | // Name is limited to 60 characters, but we want to leave space to add a |
203 | 203 | // tally if needed (for users with duplicate names); Limit to 56 chars and |
204 | 204 | // replace the middle of the string with "..." if too long |
205 | - $cleaned_name = substr_replace($cleaned_name, '...', 28, ($name_length-56)+3); |
|
205 | + $cleaned_name = substr_replace($cleaned_name, '...', 28, ($name_length - 56) + 3); |
|
206 | 206 | } |
207 | 207 | $unique_name = $cleaned_name; |
208 | 208 | while (db_result(db_query("SELECT uid FROM {users} WHERE name = '{$unique_name}' LIMIT 1"))) { |
@@ -311,15 +311,15 @@ discard block |
||
311 | 311 | elseif (!in_array($_GET['q'], $page_blacklist)) { |
312 | 312 | watchdog('boincuser', 'The BOINC scheduling server settings are not yet |
313 | 313 | configured. Please !verify for the settings to become effective.', |
314 | - array('!verify' => l(t('verify the default values') . ' <strong>' . |
|
315 | - t('and') . '</strong> ' . t('save the configuration'), |
|
314 | + array('!verify' => l(t('verify the default values').' <strong>'. |
|
315 | + t('and').'</strong> '.t('save the configuration'), |
|
316 | 316 | 'admin/boinc/scheduler', array('html' => TRUE)) |
317 | 317 | ), WATCHDOG_WARNING); |
318 | 318 | if (user_access('administer site configuration')) { |
319 | 319 | drupal_set_message(t('The BOINC scheduling server settings are not yet |
320 | 320 | configured. Please !verify for the settings to become effective', |
321 | - array('!verify' => l(t('verify the default values') . ' <strong>' . |
|
322 | - t('and') . '</strong> ' . t('save the configuration'), |
|
321 | + array('!verify' => l(t('verify the default values').' <strong>'. |
|
322 | + t('and').'</strong> '.t('save the configuration'), |
|
323 | 323 | 'admin/boinc/scheduler', array('html' => TRUE)) |
324 | 324 | )), 'warning', FALSE); |
325 | 325 | } |
@@ -399,6 +399,6 @@ discard block |
||
399 | 399 | $view = views_get_current_view(); |
400 | 400 | $account_id = $view->args[0]; |
401 | 401 | $friend_count = flag_friend_get_friend_count($account_id); |
402 | - return '<h2 class="pane-title">' . bts('Friends (@count)', |
|
403 | - array('@count' => $friend_count)) . '</h2>'; |
|
402 | + return '<h2 class="pane-title">'.bts('Friends (@count)', |
|
403 | + array('@count' => $friend_count)).'</h2>'; |
|
404 | 404 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | '#default_value' => $default['boinc_server_status_url'], |
120 | 120 | '#description' => t('An absolute URL or path relative to the site base to the server status page (e.g. %full_url or just %relative_url).', |
121 | 121 | array( |
122 | - '%full_url' => $base_url . '/server_status.php', |
|
122 | + '%full_url' => $base_url.'/server_status.php', |
|
123 | 123 | '%relative_url' => 'server_status.php', |
124 | 124 | ) |
125 | 125 | ), |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | '#default_value' => $default['boinc_app_list_url'], |
131 | 131 | '#description' => t('An absolute URL or path relative to the site base to the applications page (e.g. %full_url or just %relative_url).', |
132 | 132 | array( |
133 | - '%full_url' => $base_url . '/apps.php', |
|
133 | + '%full_url' => $base_url.'/apps.php', |
|
134 | 134 | '%relative_url' => 'apps.php', |
135 | 135 | ) |
136 | 136 | ), |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | ); |
324 | 324 | |
325 | 325 | // Define the form |
326 | - $form['boinc_other_frontpage'] = array ( |
|
326 | + $form['boinc_other_frontpage'] = array( |
|
327 | 327 | '#type' => 'textarea', |
328 | 328 | '#title' => bts('Message for site\'s Home Page'), |
329 | 329 | '#default_value' => $default['boinc_other_frontpage'], |
@@ -345,5 +345,5 @@ discard block |
||
345 | 345 | * Submit BOINC other form |
346 | 346 | */ |
347 | 347 | function boincuser_admin_other_submit($form, &$form_state) { |
348 | - drupal_set_message( bts("Status: BOINC other settings have been updated") ); |
|
348 | + drupal_set_message(bts("Status: BOINC other settings have been updated")); |
|
349 | 349 | } |
@@ -2,7 +2,7 @@ |
||
2 | 2 | // $Id: theme-settings.php,v 1.7 2008/09/11 09:36:50 johnalbin Exp $ |
3 | 3 | |
4 | 4 | // Include the definition of zen_settings() and zen_theme_get_default_settings(). |
5 | -include_once './' . drupal_get_path('theme', 'zen') . '/theme-settings.php'; |
|
5 | +include_once './'.drupal_get_path('theme', 'zen').'/theme-settings.php'; |
|
6 | 6 | |
7 | 7 | |
8 | 8 | /** |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | default: |
239 | 239 | //Normalize line breaks |
240 | 240 | $str = preg_replace('/(\r\n|\r|\n)/ms', "\n", $str); |
241 | - echo gmdate('Y-m-d H:i:s') . "\t" . str_replace( |
|
241 | + echo gmdate('Y-m-d H:i:s')."\t".str_replace( |
|
242 | 242 | "\n", |
243 | 243 | "\n \t ", |
244 | 244 | trim($str) |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | $socket_context = stream_context_create($options); |
286 | 286 | set_error_handler(array($this, 'errorHandler')); |
287 | 287 | $this->smtp_conn = stream_socket_client( |
288 | - $host . ":" . $port, |
|
288 | + $host.":".$port, |
|
289 | 289 | $errno, |
290 | 290 | $errstr, |
291 | 291 | $timeout, |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | $errstr |
318 | 318 | ); |
319 | 319 | $this->edebug( |
320 | - 'SMTP ERROR: ' . $this->error['error'] |
|
320 | + 'SMTP ERROR: '.$this->error['error'] |
|
321 | 321 | . ": $errstr ($errno)", |
322 | 322 | self::DEBUG_CLIENT |
323 | 323 | ); |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | } |
337 | 337 | // Get any announcement |
338 | 338 | $announce = $this->get_lines(); |
339 | - $this->edebug('SERVER -> CLIENT: ' . $announce, self::DEBUG_SERVER); |
|
339 | + $this->edebug('SERVER -> CLIENT: '.$announce, self::DEBUG_SERVER); |
|
340 | 340 | return true; |
341 | 341 | } |
342 | 342 | |
@@ -407,9 +407,9 @@ discard block |
||
407 | 407 | return false; |
408 | 408 | } |
409 | 409 | |
410 | - self::edebug('Auth method requested: ' . ($authtype ? $authtype : 'UNKNOWN'), self::DEBUG_LOWLEVEL); |
|
410 | + self::edebug('Auth method requested: '.($authtype ? $authtype : 'UNKNOWN'), self::DEBUG_LOWLEVEL); |
|
411 | 411 | self::edebug( |
412 | - 'Auth methods available on the server: ' . implode(',', $this->server_caps['AUTH']), |
|
412 | + 'Auth methods available on the server: '.implode(',', $this->server_caps['AUTH']), |
|
413 | 413 | self::DEBUG_LOWLEVEL |
414 | 414 | ); |
415 | 415 | |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | // Send encoded username and password |
444 | 444 | if (!$this->sendCommand( |
445 | 445 | 'User & Password', |
446 | - base64_encode("\0" . $username . "\0" . $password), |
|
446 | + base64_encode("\0".$username."\0".$password), |
|
447 | 447 | 235 |
448 | 448 | ) |
449 | 449 | ) { |
@@ -471,7 +471,7 @@ discard block |
||
471 | 471 | $oauth = $OAuth->getOauth64(); |
472 | 472 | |
473 | 473 | // Start authentication |
474 | - if (!$this->sendCommand('AUTH', 'AUTH XOAUTH2 ' . $oauth, 235)) { |
|
474 | + if (!$this->sendCommand('AUTH', 'AUTH XOAUTH2 '.$oauth, 235)) { |
|
475 | 475 | return false; |
476 | 476 | } |
477 | 477 | break; |
@@ -502,7 +502,7 @@ discard block |
||
502 | 502 | |
503 | 503 | if (!$this->sendCommand( |
504 | 504 | 'AUTH NTLM', |
505 | - 'AUTH NTLM ' . base64_encode($msg1), |
|
505 | + 'AUTH NTLM '.base64_encode($msg1), |
|
506 | 506 | 334 |
507 | 507 | ) |
508 | 508 | ) { |
@@ -534,7 +534,7 @@ discard block |
||
534 | 534 | $challenge = base64_decode(substr($this->last_reply, 4)); |
535 | 535 | |
536 | 536 | // Build the response |
537 | - $response = $username . ' ' . $this->hmac($challenge, $password); |
|
537 | + $response = $username.' '.$this->hmac($challenge, $password); |
|
538 | 538 | |
539 | 539 | // send encoded credentials |
540 | 540 | return $this->sendCommand('Username', base64_encode($response), 235); |
@@ -575,10 +575,10 @@ discard block |
||
575 | 575 | $key = str_pad($key, $bytelen, chr(0x00)); |
576 | 576 | $ipad = str_pad('', $bytelen, chr(0x36)); |
577 | 577 | $opad = str_pad('', $bytelen, chr(0x5c)); |
578 | - $k_ipad = $key ^ $ipad; |
|
579 | - $k_opad = $key ^ $opad; |
|
578 | + $k_ipad = $key^$ipad; |
|
579 | + $k_opad = $key^$opad; |
|
580 | 580 | |
581 | - return md5($k_opad . pack('H*', md5($k_ipad . $data))); |
|
581 | + return md5($k_opad.pack('H*', md5($k_ipad.$data))); |
|
582 | 582 | } |
583 | 583 | |
584 | 584 | /** |
@@ -690,7 +690,7 @@ discard block |
||
690 | 690 | } |
691 | 691 | //If processing headers add a LWSP-char to the front of new line RFC822 section 3.1.1 |
692 | 692 | if ($in_headers) { |
693 | - $line = "\t" . $line; |
|
693 | + $line = "\t".$line; |
|
694 | 694 | } |
695 | 695 | } |
696 | 696 | $lines_out[] = $line; |
@@ -699,16 +699,16 @@ discard block |
||
699 | 699 | foreach ($lines_out as $line_out) { |
700 | 700 | //RFC2821 section 4.5.2 |
701 | 701 | if (!empty($line_out) and $line_out[0] == '.') { |
702 | - $line_out = '.' . $line_out; |
|
702 | + $line_out = '.'.$line_out; |
|
703 | 703 | } |
704 | - $this->client_send($line_out . self::CRLF); |
|
704 | + $this->client_send($line_out.self::CRLF); |
|
705 | 705 | } |
706 | 706 | } |
707 | 707 | |
708 | 708 | //Message data has been sent, complete the command |
709 | 709 | //Increase timelimit for end of DATA command |
710 | 710 | $savetimelimit = $this->Timelimit; |
711 | - $this->Timelimit = $this->Timelimit * 2; |
|
711 | + $this->Timelimit = $this->Timelimit*2; |
|
712 | 712 | $result = $this->sendCommand('DATA END', '.', 250); |
713 | 713 | //Restore timelimit |
714 | 714 | $this->Timelimit = $savetimelimit; |
@@ -742,7 +742,7 @@ discard block |
||
742 | 742 | */ |
743 | 743 | protected function sendHello($hello, $host) |
744 | 744 | { |
745 | - $noerror = $this->sendCommand($hello, $hello . ' ' . $host, 250); |
|
745 | + $noerror = $this->sendCommand($hello, $hello.' '.$host, 250); |
|
746 | 746 | $this->helo_rply = $this->last_reply; |
747 | 747 | if ($noerror) { |
748 | 748 | $this->parseHelloFields($hello); |
@@ -810,7 +810,7 @@ discard block |
||
810 | 810 | $useVerp = ($this->do_verp ? ' XVERP' : ''); |
811 | 811 | return $this->sendCommand( |
812 | 812 | 'MAIL FROM', |
813 | - 'MAIL FROM:<' . $from . '>' . $useVerp, |
|
813 | + 'MAIL FROM:<'.$from.'>'.$useVerp, |
|
814 | 814 | 250 |
815 | 815 | ); |
816 | 816 | } |
@@ -847,7 +847,7 @@ discard block |
||
847 | 847 | { |
848 | 848 | return $this->sendCommand( |
849 | 849 | 'RCPT TO', |
850 | - 'RCPT TO:<' . $address . '>', |
|
850 | + 'RCPT TO:<'.$address.'>', |
|
851 | 851 | array(250, 251) |
852 | 852 | ); |
853 | 853 | } |
@@ -883,7 +883,7 @@ discard block |
||
883 | 883 | $this->setError("Command '$command' contained line breaks"); |
884 | 884 | return false; |
885 | 885 | } |
886 | - $this->client_send($commandstring . self::CRLF); |
|
886 | + $this->client_send($commandstring.self::CRLF); |
|
887 | 887 | |
888 | 888 | $this->last_reply = $this->get_lines(); |
889 | 889 | // Fetch SMTP code and possible error code explanation |
@@ -904,7 +904,7 @@ discard block |
||
904 | 904 | $detail = substr($this->last_reply, 4); |
905 | 905 | } |
906 | 906 | |
907 | - $this->edebug('SERVER -> CLIENT: ' . $this->last_reply, self::DEBUG_SERVER); |
|
907 | + $this->edebug('SERVER -> CLIENT: '.$this->last_reply, self::DEBUG_SERVER); |
|
908 | 908 | |
909 | 909 | if (!in_array($code, (array)$expect)) { |
910 | 910 | $this->setError( |
@@ -914,7 +914,7 @@ discard block |
||
914 | 914 | $code_ex |
915 | 915 | ); |
916 | 916 | $this->edebug( |
917 | - 'SMTP ERROR: ' . $this->error['error'] . ': ' . $this->last_reply, |
|
917 | + 'SMTP ERROR: '.$this->error['error'].': '.$this->last_reply, |
|
918 | 918 | self::DEBUG_CLIENT |
919 | 919 | ); |
920 | 920 | return false; |
@@ -976,7 +976,7 @@ discard block |
||
976 | 976 | public function turn() |
977 | 977 | { |
978 | 978 | $this->setError('The SMTP TURN command is not implemented'); |
979 | - $this->edebug('SMTP NOTICE: ' . $this->error['error'], self::DEBUG_CLIENT); |
|
979 | + $this->edebug('SMTP NOTICE: '.$this->error['error'], self::DEBUG_CLIENT); |
|
980 | 980 | return false; |
981 | 981 | } |
982 | 982 | |
@@ -1097,7 +1097,7 @@ discard block |
||
1097 | 1097 | $info = stream_get_meta_data($this->smtp_conn); |
1098 | 1098 | if ($info['timed_out']) { |
1099 | 1099 | $this->edebug( |
1100 | - 'SMTP -> get_lines(): timed-out (' . $this->Timeout . ' sec)', |
|
1100 | + 'SMTP -> get_lines(): timed-out ('.$this->Timeout.' sec)', |
|
1101 | 1101 | self::DEBUG_LOWLEVEL |
1102 | 1102 | ); |
1103 | 1103 | break; |
@@ -1106,7 +1106,7 @@ discard block |
||
1106 | 1106 | if ($endtime and time() > $endtime) { |
1107 | 1107 | $this->edebug( |
1108 | 1108 | 'SMTP -> get_lines(): timelimit reached ('. |
1109 | - $this->Timelimit . ' sec)', |
|
1109 | + $this->Timelimit.' sec)', |
|
1110 | 1110 | self::DEBUG_LOWLEVEL |
1111 | 1111 | ); |
1112 | 1112 | break; |
@@ -1218,7 +1218,7 @@ discard block |
||
1218 | 1218 | $errmsg |
1219 | 1219 | ); |
1220 | 1220 | $this->edebug( |
1221 | - $notice . ' Error number ' . $errno . '. "Error notice: ' . $errmsg, |
|
1221 | + $notice.' Error number '.$errno.'. "Error notice: '.$errmsg, |
|
1222 | 1222 | self::DEBUG_CONNECTION |
1223 | 1223 | ); |
1224 | 1224 | } |
@@ -1238,8 +1238,8 @@ discard block |
||
1238 | 1238 | return null; |
1239 | 1239 | } |
1240 | 1240 | |
1241 | - foreach($this->smtp_transaction_id_patterns as $smtp_transaction_id_pattern) { |
|
1242 | - if(preg_match($smtp_transaction_id_pattern, $reply, $matches)) { |
|
1241 | + foreach ($this->smtp_transaction_id_patterns as $smtp_transaction_id_pattern) { |
|
1242 | + if (preg_match($smtp_transaction_id_pattern, $reply, $matches)) { |
|
1243 | 1243 | return $matches[1]; |
1244 | 1244 | } |
1245 | 1245 | } |
@@ -72,6 +72,6 @@ |
||
72 | 72 | public function getOauth64() |
73 | 73 | { |
74 | 74 | $token = $this->getToken(); |
75 | - return base64_encode("user=" . $this->oauthUserEmail . "\001auth=Bearer " . $token . "\001\001"); |
|
75 | + return base64_encode("user=".$this->oauthUserEmail."\001auth=Bearer ".$token."\001\001"); |
|
76 | 76 | } |
77 | 77 | } |
@@ -686,7 +686,7 @@ discard block |
||
686 | 686 | private function mailPassthru($to, $subject, $body, $header, $params) |
687 | 687 | { |
688 | 688 | //Check overloading of mail function to avoid double-encoding |
689 | - if (ini_get('mbstring.func_overload') & 1) { |
|
689 | + if (ini_get('mbstring.func_overload')&1) { |
|
690 | 690 | $subject = $this->secureHeader($subject); |
691 | 691 | } else { |
692 | 692 | $subject = $this->encodeHeader($this->secureHeader($subject)); |
@@ -736,11 +736,11 @@ discard block |
||
736 | 736 | default: |
737 | 737 | //Normalize line breaks |
738 | 738 | $str = preg_replace('/\r\n?/ms', "\n", $str); |
739 | - echo gmdate('Y-m-d H:i:s') . "\t" . str_replace( |
|
739 | + echo gmdate('Y-m-d H:i:s')."\t".str_replace( |
|
740 | 740 | "\n", |
741 | 741 | "\n \t ", |
742 | 742 | trim($str) |
743 | - ) . "\n"; |
|
743 | + )."\n"; |
|
744 | 744 | } |
745 | 745 | } |
746 | 746 | |
@@ -872,7 +872,7 @@ discard block |
||
872 | 872 | $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim |
873 | 873 | if (($pos = strrpos($address, '@')) === false) { |
874 | 874 | // At-sign is misssing. |
875 | - $error_message = $this->lang('invalid_address') . " (addAnAddress $kind): $address"; |
|
875 | + $error_message = $this->lang('invalid_address')." (addAnAddress $kind): $address"; |
|
876 | 876 | $this->setError($error_message); |
877 | 877 | $this->edebug($error_message); |
878 | 878 | if ($this->exceptions) { |
@@ -913,7 +913,7 @@ discard block |
||
913 | 913 | protected function addAnAddress($kind, $address, $name = '') |
914 | 914 | { |
915 | 915 | if (!in_array($kind, array('to', 'cc', 'bcc', 'Reply-To'))) { |
916 | - $error_message = $this->lang('Invalid recipient kind: ') . $kind; |
|
916 | + $error_message = $this->lang('Invalid recipient kind: ').$kind; |
|
917 | 917 | $this->setError($error_message); |
918 | 918 | $this->edebug($error_message); |
919 | 919 | if ($this->exceptions) { |
@@ -922,7 +922,7 @@ discard block |
||
922 | 922 | return false; |
923 | 923 | } |
924 | 924 | if (!$this->validateAddress($address)) { |
925 | - $error_message = $this->lang('invalid_address') . " (addAnAddress $kind): $address"; |
|
925 | + $error_message = $this->lang('invalid_address')." (addAnAddress $kind): $address"; |
|
926 | 926 | $this->setError($error_message); |
927 | 927 | $this->edebug($error_message); |
928 | 928 | if ($this->exceptions) { |
@@ -963,10 +963,10 @@ discard block |
||
963 | 963 | $list = imap_rfc822_parse_adrlist($addrstr, ''); |
964 | 964 | foreach ($list as $address) { |
965 | 965 | if ($address->host != '.SYNTAX-ERROR.') { |
966 | - if ($this->validateAddress($address->mailbox . '@' . $address->host)) { |
|
966 | + if ($this->validateAddress($address->mailbox.'@'.$address->host)) { |
|
967 | 967 | $addresses[] = array( |
968 | 968 | 'name' => (property_exists($address, 'personal') ? $address->personal : ''), |
969 | - 'address' => $address->mailbox . '@' . $address->host |
|
969 | + 'address' => $address->mailbox.'@'.$address->host |
|
970 | 970 | ); |
971 | 971 | } |
972 | 972 | } |
@@ -1016,7 +1016,7 @@ discard block |
||
1016 | 1016 | if (($pos = strrpos($address, '@')) === false or |
1017 | 1017 | (!$this->has8bitChars(substr($address, ++$pos)) or !$this->idnSupported()) and |
1018 | 1018 | !$this->validateAddress($address)) { |
1019 | - $error_message = $this->lang('invalid_address') . " (setFrom) $address"; |
|
1019 | + $error_message = $this->lang('invalid_address')." (setFrom) $address"; |
|
1020 | 1020 | $this->setError($error_message); |
1021 | 1021 | $this->edebug($error_message); |
1022 | 1022 | if ($this->exceptions) { |
@@ -1108,29 +1108,29 @@ discard block |
||
1108 | 1108 | * Feel free to use and redistribute this code. But please keep this copyright notice. |
1109 | 1109 | */ |
1110 | 1110 | return (boolean)preg_match( |
1111 | - '/^(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){255,})(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){65,}@)' . |
|
1112 | - '((?>(?>(?>((?>(?>(?>\x0D\x0A)?[\t ])+|(?>[\t ]*\x0D\x0A)?[\t ]+)?)(\((?>(?2)' . |
|
1113 | - '(?>[\x01-\x08\x0B\x0C\x0E-\'*-\[\]-\x7F]|\\\[\x00-\x7F]|(?3)))*(?2)\)))+(?2))|(?2))?)' . |
|
1114 | - '([!#-\'*+\/-9=?^-~-]+|"(?>(?2)(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\x7F]))*' . |
|
1115 | - '(?2)")(?>(?1)\.(?1)(?4))*(?1)@(?!(?1)[a-z0-9-]{64,})(?1)(?>([a-z0-9](?>[a-z0-9-]*[a-z0-9])?)' . |
|
1116 | - '(?>(?1)\.(?!(?1)[a-z0-9-]{64,})(?1)(?5)){0,126}|\[(?:(?>IPv6:(?>([a-f0-9]{1,4})(?>:(?6)){7}' . |
|
1117 | - '|(?!(?:.*[a-f0-9][:\]]){8,})((?6)(?>:(?6)){0,6})?::(?7)?))|(?>(?>IPv6:(?>(?6)(?>:(?6)){5}:' . |
|
1118 | - '|(?!(?:.*[a-f0-9]:){6,})(?8)?::(?>((?6)(?>:(?6)){0,4}):)?))?(25[0-5]|2[0-4][0-9]|1[0-9]{2}' . |
|
1111 | + '/^(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){255,})(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){65,}@)'. |
|
1112 | + '((?>(?>(?>((?>(?>(?>\x0D\x0A)?[\t ])+|(?>[\t ]*\x0D\x0A)?[\t ]+)?)(\((?>(?2)'. |
|
1113 | + '(?>[\x01-\x08\x0B\x0C\x0E-\'*-\[\]-\x7F]|\\\[\x00-\x7F]|(?3)))*(?2)\)))+(?2))|(?2))?)'. |
|
1114 | + '([!#-\'*+\/-9=?^-~-]+|"(?>(?2)(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\x7F]))*'. |
|
1115 | + '(?2)")(?>(?1)\.(?1)(?4))*(?1)@(?!(?1)[a-z0-9-]{64,})(?1)(?>([a-z0-9](?>[a-z0-9-]*[a-z0-9])?)'. |
|
1116 | + '(?>(?1)\.(?!(?1)[a-z0-9-]{64,})(?1)(?5)){0,126}|\[(?:(?>IPv6:(?>([a-f0-9]{1,4})(?>:(?6)){7}'. |
|
1117 | + '|(?!(?:.*[a-f0-9][:\]]){8,})((?6)(?>:(?6)){0,6})?::(?7)?))|(?>(?>IPv6:(?>(?6)(?>:(?6)){5}:'. |
|
1118 | + '|(?!(?:.*[a-f0-9]:){6,})(?8)?::(?>((?6)(?>:(?6)){0,4}):)?))?(25[0-5]|2[0-4][0-9]|1[0-9]{2}'. |
|
1119 | 1119 | '|[1-9]?[0-9])(?>\.(?9)){3}))\])(?1)$/isD', |
1120 | 1120 | $address |
1121 | 1121 | ); |
1122 | 1122 | case 'pcre': |
1123 | 1123 | //An older regex that doesn't need a recent PCRE |
1124 | 1124 | return (boolean)preg_match( |
1125 | - '/^(?!(?>"?(?>\\\[ -~]|[^"])"?){255,})(?!(?>"?(?>\\\[ -~]|[^"])"?){65,}@)(?>' . |
|
1126 | - '[!#-\'*+\/-9=?^-~-]+|"(?>(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\xFF]))*")' . |
|
1127 | - '(?>\.(?>[!#-\'*+\/-9=?^-~-]+|"(?>(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\xFF]))*"))*' . |
|
1128 | - '@(?>(?![a-z0-9-]{64,})(?>[a-z0-9](?>[a-z0-9-]*[a-z0-9])?)(?>\.(?![a-z0-9-]{64,})' . |
|
1129 | - '(?>[a-z0-9](?>[a-z0-9-]*[a-z0-9])?)){0,126}|\[(?:(?>IPv6:(?>(?>[a-f0-9]{1,4})(?>:' . |
|
1130 | - '[a-f0-9]{1,4}){7}|(?!(?:.*[a-f0-9][:\]]){8,})(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,6})?' . |
|
1131 | - '::(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,6})?))|(?>(?>IPv6:(?>[a-f0-9]{1,4}(?>:' . |
|
1132 | - '[a-f0-9]{1,4}){5}:|(?!(?:.*[a-f0-9]:){6,})(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,4})?' . |
|
1133 | - '::(?>(?:[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,4}):)?))?(?>25[0-5]|2[0-4][0-9]|1[0-9]{2}' . |
|
1125 | + '/^(?!(?>"?(?>\\\[ -~]|[^"])"?){255,})(?!(?>"?(?>\\\[ -~]|[^"])"?){65,}@)(?>'. |
|
1126 | + '[!#-\'*+\/-9=?^-~-]+|"(?>(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\xFF]))*")'. |
|
1127 | + '(?>\.(?>[!#-\'*+\/-9=?^-~-]+|"(?>(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\xFF]))*"))*'. |
|
1128 | + '@(?>(?![a-z0-9-]{64,})(?>[a-z0-9](?>[a-z0-9-]*[a-z0-9])?)(?>\.(?![a-z0-9-]{64,})'. |
|
1129 | + '(?>[a-z0-9](?>[a-z0-9-]*[a-z0-9])?)){0,126}|\[(?:(?>IPv6:(?>(?>[a-f0-9]{1,4})(?>:'. |
|
1130 | + '[a-f0-9]{1,4}){7}|(?!(?:.*[a-f0-9][:\]]){8,})(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,6})?'. |
|
1131 | + '::(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,6})?))|(?>(?>IPv6:(?>[a-f0-9]{1,4}(?>:'. |
|
1132 | + '[a-f0-9]{1,4}){5}:|(?!(?:.*[a-f0-9]:){6,})(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,4})?'. |
|
1133 | + '::(?>(?:[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,4}):)?))?(?>25[0-5]|2[0-4][0-9]|1[0-9]{2}'. |
|
1134 | 1134 | '|[1-9]?[0-9])(?>\.(?>25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}))\])$/isD', |
1135 | 1135 | $address |
1136 | 1136 | ); |
@@ -1140,7 +1140,7 @@ discard block |
||
1140 | 1140 | * @link http://www.whatwg.org/specs/web-apps/current-work/#e-mail-state-(type=email) |
1141 | 1141 | */ |
1142 | 1142 | return (boolean)preg_match( |
1143 | - '/^[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}' . |
|
1143 | + '/^[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}'. |
|
1144 | 1144 | '[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/sD', |
1145 | 1145 | $address |
1146 | 1146 | ); |
@@ -1189,9 +1189,8 @@ discard block |
||
1189 | 1189 | if ($this->has8bitChars($domain) and @mb_check_encoding($domain, $this->CharSet)) { |
1190 | 1190 | $domain = mb_convert_encoding($domain, 'UTF-8', $this->CharSet); |
1191 | 1191 | if (($punycode = defined('INTL_IDNA_VARIANT_UTS46') ? |
1192 | - idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46) : |
|
1193 | - idn_to_ascii($domain)) !== false) { |
|
1194 | - return substr($address, 0, $pos) . $punycode; |
|
1192 | + idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46) : idn_to_ascii($domain)) !== false) { |
|
1193 | + return substr($address, 0, $pos).$punycode; |
|
1195 | 1194 | } |
1196 | 1195 | } |
1197 | 1196 | } |
@@ -1249,7 +1248,7 @@ discard block |
||
1249 | 1248 | } |
1250 | 1249 | $this->$address_kind = $this->punyencodeAddress($this->$address_kind); |
1251 | 1250 | if (!$this->validateAddress($this->$address_kind)) { |
1252 | - $error_message = $this->lang('invalid_address') . ' (punyEncode) ' . $this->$address_kind; |
|
1251 | + $error_message = $this->lang('invalid_address').' (punyEncode) '.$this->$address_kind; |
|
1253 | 1252 | $this->setError($error_message); |
1254 | 1253 | $this->edebug($error_message); |
1255 | 1254 | if ($this->exceptions) { |
@@ -1300,12 +1299,12 @@ discard block |
||
1300 | 1299 | ) |
1301 | 1300 | ) { |
1302 | 1301 | $header_dkim = $this->DKIM_Add( |
1303 | - $this->MIMEHeader . $this->mailHeader, |
|
1302 | + $this->MIMEHeader.$this->mailHeader, |
|
1304 | 1303 | $this->encodeHeader($this->secureHeader($this->Subject)), |
1305 | 1304 | $this->MIMEBody |
1306 | 1305 | ); |
1307 | - $this->MIMEHeader = rtrim($this->MIMEHeader, "\r\n ") . self::CRLF . |
|
1308 | - str_replace("\r\n", "\n", $header_dkim) . self::CRLF; |
|
1306 | + $this->MIMEHeader = rtrim($this->MIMEHeader, "\r\n ").self::CRLF. |
|
1307 | + str_replace("\r\n", "\n", $header_dkim).self::CRLF; |
|
1309 | 1308 | } |
1310 | 1309 | return true; |
1311 | 1310 | } catch (phpmailerException $exc) { |
@@ -1385,9 +1384,9 @@ discard block |
||
1385 | 1384 | if ($this->SingleTo) { |
1386 | 1385 | foreach ($this->SingleToArray as $toAddr) { |
1387 | 1386 | if (!@$mail = popen($sendmail, 'w')) { |
1388 | - throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); |
|
1387 | + throw new phpmailerException($this->lang('execute').$this->Sendmail, self::STOP_CRITICAL); |
|
1389 | 1388 | } |
1390 | - fputs($mail, 'To: ' . $toAddr . "\n"); |
|
1389 | + fputs($mail, 'To: '.$toAddr."\n"); |
|
1391 | 1390 | fputs($mail, $header); |
1392 | 1391 | fputs($mail, $body); |
1393 | 1392 | $result = pclose($mail); |
@@ -1401,12 +1400,12 @@ discard block |
||
1401 | 1400 | $this->From |
1402 | 1401 | ); |
1403 | 1402 | if ($result != 0) { |
1404 | - throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); |
|
1403 | + throw new phpmailerException($this->lang('execute').$this->Sendmail, self::STOP_CRITICAL); |
|
1405 | 1404 | } |
1406 | 1405 | } |
1407 | 1406 | } else { |
1408 | 1407 | if (!@$mail = popen($sendmail, 'w')) { |
1409 | - throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); |
|
1408 | + throw new phpmailerException($this->lang('execute').$this->Sendmail, self::STOP_CRITICAL); |
|
1410 | 1409 | } |
1411 | 1410 | fputs($mail, $header); |
1412 | 1411 | fputs($mail, $body); |
@@ -1421,7 +1420,7 @@ discard block |
||
1421 | 1420 | $this->From |
1422 | 1421 | ); |
1423 | 1422 | if ($result != 0) { |
1424 | - throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); |
|
1423 | + throw new phpmailerException($this->lang('execute').$this->Sendmail, self::STOP_CRITICAL); |
|
1425 | 1424 | } |
1426 | 1425 | } |
1427 | 1426 | return true; |
@@ -1546,7 +1545,7 @@ discard block |
||
1546 | 1545 | $smtp_from = $this->From; |
1547 | 1546 | } |
1548 | 1547 | if (!$this->smtp->mail($smtp_from)) { |
1549 | - $this->setError($this->lang('from_failed') . $smtp_from . ' : ' . implode(',', $this->smtp->getError())); |
|
1548 | + $this->setError($this->lang('from_failed').$smtp_from.' : '.implode(',', $this->smtp->getError())); |
|
1550 | 1549 | throw new phpmailerException($this->ErrorInfo, self::STOP_CRITICAL); |
1551 | 1550 | } |
1552 | 1551 | |
@@ -1565,7 +1564,7 @@ discard block |
||
1565 | 1564 | } |
1566 | 1565 | |
1567 | 1566 | // Only send the DATA command if we have viable recipients |
1568 | - if ((count($this->all_recipients) > count($bad_rcpt)) and !$this->smtp->data($header . $body)) { |
|
1567 | + if ((count($this->all_recipients) > count($bad_rcpt)) and !$this->smtp->data($header.$body)) { |
|
1569 | 1568 | throw new phpmailerException($this->lang('data_not_accepted'), self::STOP_CRITICAL); |
1570 | 1569 | } |
1571 | 1570 | if ($this->SMTPKeepAlive) { |
@@ -1578,10 +1577,10 @@ discard block |
||
1578 | 1577 | if (count($bad_rcpt) > 0) { |
1579 | 1578 | $errstr = ''; |
1580 | 1579 | foreach ($bad_rcpt as $bad) { |
1581 | - $errstr .= $bad['to'] . ': ' . $bad['error']; |
|
1580 | + $errstr .= $bad['to'].': '.$bad['error']; |
|
1582 | 1581 | } |
1583 | 1582 | throw new phpmailerException( |
1584 | - $this->lang('recipients_failed') . $errstr, |
|
1583 | + $this->lang('recipients_failed').$errstr, |
|
1585 | 1584 | self::STOP_CONTINUE |
1586 | 1585 | ); |
1587 | 1586 | } |
@@ -1657,7 +1656,7 @@ discard block |
||
1657 | 1656 | if ($tport > 0 and $tport < 65536) { |
1658 | 1657 | $port = $tport; |
1659 | 1658 | } |
1660 | - if ($this->smtp->connect($prefix . $host, $port, $this->Timeout, $options)) { |
|
1659 | + if ($this->smtp->connect($prefix.$host, $port, $this->Timeout, $options)) { |
|
1661 | 1660 | try { |
1662 | 1661 | if ($this->Helo) { |
1663 | 1662 | $hello = $this->Helo; |
@@ -1772,14 +1771,14 @@ discard block |
||
1772 | 1771 | ); |
1773 | 1772 | if (empty($lang_path)) { |
1774 | 1773 | // Calculate an absolute path so it can work if CWD is not here |
1775 | - $lang_path = dirname(__FILE__). DIRECTORY_SEPARATOR . 'language'. DIRECTORY_SEPARATOR; |
|
1774 | + $lang_path = dirname(__FILE__).DIRECTORY_SEPARATOR.'language'.DIRECTORY_SEPARATOR; |
|
1776 | 1775 | } |
1777 | 1776 | //Validate $langcode |
1778 | 1777 | if (!preg_match('/^[a-z]{2}(?:_[a-zA-Z]{2})?$/', $langcode)) { |
1779 | 1778 | $langcode = 'en'; |
1780 | 1779 | } |
1781 | 1780 | $foundlang = true; |
1782 | - $lang_file = $lang_path . 'phpmailer.lang-' . $langcode . '.php'; |
|
1781 | + $lang_file = $lang_path.'phpmailer.lang-'.$langcode.'.php'; |
|
1783 | 1782 | // There is no English translation file |
1784 | 1783 | if ($langcode != 'en') { |
1785 | 1784 | // Make sure language file path is readable |
@@ -1820,7 +1819,7 @@ discard block |
||
1820 | 1819 | foreach ($addr as $address) { |
1821 | 1820 | $addresses[] = $this->addrFormat($address); |
1822 | 1821 | } |
1823 | - return $type . ': ' . implode(', ', $addresses) . $this->LE; |
|
1822 | + return $type.': '.implode(', ', $addresses).$this->LE; |
|
1824 | 1823 | } |
1825 | 1824 | |
1826 | 1825 | /** |
@@ -1835,9 +1834,9 @@ discard block |
||
1835 | 1834 | if (empty($addr[1])) { // No name provided |
1836 | 1835 | return $this->secureHeader($addr[0]); |
1837 | 1836 | } else { |
1838 | - return $this->encodeHeader($this->secureHeader($addr[1]), 'phrase') . ' <' . $this->secureHeader( |
|
1837 | + return $this->encodeHeader($this->secureHeader($addr[1]), 'phrase').' <'.$this->secureHeader( |
|
1839 | 1838 | $addr[0] |
1840 | - ) . '>'; |
|
1839 | + ).'>'; |
|
1841 | 1840 | } |
1842 | 1841 | } |
1843 | 1842 | |
@@ -1894,10 +1893,10 @@ discard block |
||
1894 | 1893 | } |
1895 | 1894 | $part = substr($word, 0, $len); |
1896 | 1895 | $word = substr($word, $len); |
1897 | - $buf .= ' ' . $part; |
|
1898 | - $message .= $buf . sprintf('=%s', self::CRLF); |
|
1896 | + $buf .= ' '.$part; |
|
1897 | + $message .= $buf.sprintf('=%s', self::CRLF); |
|
1899 | 1898 | } else { |
1900 | - $message .= $buf . $soft_break; |
|
1899 | + $message .= $buf.$soft_break; |
|
1901 | 1900 | } |
1902 | 1901 | $buf = ''; |
1903 | 1902 | } |
@@ -1917,7 +1916,7 @@ discard block |
||
1917 | 1916 | $word = substr($word, $len); |
1918 | 1917 | |
1919 | 1918 | if (strlen($word) > 0) { |
1920 | - $message .= $part . sprintf('=%s', self::CRLF); |
|
1919 | + $message .= $part.sprintf('=%s', self::CRLF); |
|
1921 | 1920 | } else { |
1922 | 1921 | $buf = $part; |
1923 | 1922 | } |
@@ -1930,13 +1929,13 @@ discard block |
||
1930 | 1929 | $buf .= $word; |
1931 | 1930 | |
1932 | 1931 | if (strlen($buf) > $length and $buf_o != '') { |
1933 | - $message .= $buf_o . $soft_break; |
|
1932 | + $message .= $buf_o.$soft_break; |
|
1934 | 1933 | $buf = $word; |
1935 | 1934 | } |
1936 | 1935 | } |
1937 | 1936 | $firstword = false; |
1938 | 1937 | } |
1939 | - $message .= $buf . self::CRLF; |
|
1938 | + $message .= $buf.self::CRLF; |
|
1940 | 1939 | } |
1941 | 1940 | |
1942 | 1941 | return $message; |
@@ -2085,7 +2084,7 @@ discard block |
||
2085 | 2084 | if ($this->XMailer == '') { |
2086 | 2085 | $result .= $this->headerLine( |
2087 | 2086 | 'X-Mailer', |
2088 | - 'PHPMailer ' . $this->Version . ' (https://github.com/PHPMailer/PHPMailer)' |
|
2087 | + 'PHPMailer '.$this->Version.' (https://github.com/PHPMailer/PHPMailer)' |
|
2089 | 2088 | ); |
2090 | 2089 | } else { |
2091 | 2090 | $myXmailer = trim($this->XMailer); |
@@ -2095,7 +2094,7 @@ discard block |
||
2095 | 2094 | } |
2096 | 2095 | |
2097 | 2096 | if ($this->ConfirmReadingTo != '') { |
2098 | - $result .= $this->headerLine('Disposition-Notification-To', '<' . $this->ConfirmReadingTo . '>'); |
|
2097 | + $result .= $this->headerLine('Disposition-Notification-To', '<'.$this->ConfirmReadingTo.'>'); |
|
2099 | 2098 | } |
2100 | 2099 | |
2101 | 2100 | // Add custom headers |
@@ -2125,23 +2124,23 @@ discard block |
||
2125 | 2124 | switch ($this->message_type) { |
2126 | 2125 | case 'inline': |
2127 | 2126 | $result .= $this->headerLine('Content-Type', 'multipart/related;'); |
2128 | - $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"'); |
|
2127 | + $result .= $this->textLine("\tboundary=\"".$this->boundary[1].'"'); |
|
2129 | 2128 | break; |
2130 | 2129 | case 'attach': |
2131 | 2130 | case 'inline_attach': |
2132 | 2131 | case 'alt_attach': |
2133 | 2132 | case 'alt_inline_attach': |
2134 | 2133 | $result .= $this->headerLine('Content-Type', 'multipart/mixed;'); |
2135 | - $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"'); |
|
2134 | + $result .= $this->textLine("\tboundary=\"".$this->boundary[1].'"'); |
|
2136 | 2135 | break; |
2137 | 2136 | case 'alt': |
2138 | 2137 | case 'alt_inline': |
2139 | 2138 | $result .= $this->headerLine('Content-Type', 'multipart/alternative;'); |
2140 | - $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"'); |
|
2139 | + $result .= $this->textLine("\tboundary=\"".$this->boundary[1].'"'); |
|
2141 | 2140 | break; |
2142 | 2141 | default: |
2143 | 2142 | // Catches case 'plain': and case '': |
2144 | - $result .= $this->textLine('Content-Type: ' . $this->ContentType . '; charset=' . $this->CharSet); |
|
2143 | + $result .= $this->textLine('Content-Type: '.$this->ContentType.'; charset='.$this->CharSet); |
|
2145 | 2144 | $ismultipart = false; |
2146 | 2145 | break; |
2147 | 2146 | } |
@@ -2175,7 +2174,7 @@ discard block |
||
2175 | 2174 | */ |
2176 | 2175 | public function getSentMIMEMessage() |
2177 | 2176 | { |
2178 | - return rtrim($this->MIMEHeader . $this->mailHeader, "\n\r") . self::CRLF . self::CRLF . $this->MIMEBody; |
|
2177 | + return rtrim($this->MIMEHeader.$this->mailHeader, "\n\r").self::CRLF.self::CRLF.$this->MIMEBody; |
|
2179 | 2178 | } |
2180 | 2179 | |
2181 | 2180 | /** |
@@ -2198,12 +2197,12 @@ discard block |
||
2198 | 2197 | $body = ''; |
2199 | 2198 | //Create unique IDs and preset boundaries |
2200 | 2199 | $this->uniqueid = $this->generateId(); |
2201 | - $this->boundary[1] = 'b1_' . $this->uniqueid; |
|
2202 | - $this->boundary[2] = 'b2_' . $this->uniqueid; |
|
2203 | - $this->boundary[3] = 'b3_' . $this->uniqueid; |
|
2200 | + $this->boundary[1] = 'b1_'.$this->uniqueid; |
|
2201 | + $this->boundary[2] = 'b2_'.$this->uniqueid; |
|
2202 | + $this->boundary[3] = 'b3_'.$this->uniqueid; |
|
2204 | 2203 | |
2205 | 2204 | if ($this->sign_key_file) { |
2206 | - $body .= $this->getMailMIME() . $this->LE; |
|
2205 | + $body .= $this->getMailMIME().$this->LE; |
|
2207 | 2206 | } |
2208 | 2207 | |
2209 | 2208 | $this->setWordWrap(); |
@@ -2236,31 +2235,31 @@ discard block |
||
2236 | 2235 | $altBodyEncoding = 'quoted-printable'; |
2237 | 2236 | } |
2238 | 2237 | //Use this as a preamble in all multipart message types |
2239 | - $mimepre = "This is a multi-part message in MIME format." . $this->LE . $this->LE; |
|
2238 | + $mimepre = "This is a multi-part message in MIME format.".$this->LE.$this->LE; |
|
2240 | 2239 | switch ($this->message_type) { |
2241 | 2240 | case 'inline': |
2242 | 2241 | $body .= $mimepre; |
2243 | 2242 | $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, '', $bodyEncoding); |
2244 | 2243 | $body .= $this->encodeString($this->Body, $bodyEncoding); |
2245 | - $body .= $this->LE . $this->LE; |
|
2244 | + $body .= $this->LE.$this->LE; |
|
2246 | 2245 | $body .= $this->attachAll('inline', $this->boundary[1]); |
2247 | 2246 | break; |
2248 | 2247 | case 'attach': |
2249 | 2248 | $body .= $mimepre; |
2250 | 2249 | $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, '', $bodyEncoding); |
2251 | 2250 | $body .= $this->encodeString($this->Body, $bodyEncoding); |
2252 | - $body .= $this->LE . $this->LE; |
|
2251 | + $body .= $this->LE.$this->LE; |
|
2253 | 2252 | $body .= $this->attachAll('attachment', $this->boundary[1]); |
2254 | 2253 | break; |
2255 | 2254 | case 'inline_attach': |
2256 | 2255 | $body .= $mimepre; |
2257 | - $body .= $this->textLine('--' . $this->boundary[1]); |
|
2256 | + $body .= $this->textLine('--'.$this->boundary[1]); |
|
2258 | 2257 | $body .= $this->headerLine('Content-Type', 'multipart/related;'); |
2259 | - $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); |
|
2258 | + $body .= $this->textLine("\tboundary=\"".$this->boundary[2].'"'); |
|
2260 | 2259 | $body .= $this->LE; |
2261 | 2260 | $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, '', $bodyEncoding); |
2262 | 2261 | $body .= $this->encodeString($this->Body, $bodyEncoding); |
2263 | - $body .= $this->LE . $this->LE; |
|
2262 | + $body .= $this->LE.$this->LE; |
|
2264 | 2263 | $body .= $this->attachAll('inline', $this->boundary[2]); |
2265 | 2264 | $body .= $this->LE; |
2266 | 2265 | $body .= $this->attachAll('attachment', $this->boundary[1]); |
@@ -2269,14 +2268,14 @@ discard block |
||
2269 | 2268 | $body .= $mimepre; |
2270 | 2269 | $body .= $this->getBoundary($this->boundary[1], $altBodyCharSet, 'text/plain', $altBodyEncoding); |
2271 | 2270 | $body .= $this->encodeString($this->AltBody, $altBodyEncoding); |
2272 | - $body .= $this->LE . $this->LE; |
|
2271 | + $body .= $this->LE.$this->LE; |
|
2273 | 2272 | $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, 'text/html', $bodyEncoding); |
2274 | 2273 | $body .= $this->encodeString($this->Body, $bodyEncoding); |
2275 | - $body .= $this->LE . $this->LE; |
|
2274 | + $body .= $this->LE.$this->LE; |
|
2276 | 2275 | if (!empty($this->Ical)) { |
2277 | 2276 | $body .= $this->getBoundary($this->boundary[1], '', 'text/calendar; method=REQUEST', ''); |
2278 | 2277 | $body .= $this->encodeString($this->Ical, $this->Encoding); |
2279 | - $body .= $this->LE . $this->LE; |
|
2278 | + $body .= $this->LE.$this->LE; |
|
2280 | 2279 | } |
2281 | 2280 | $body .= $this->endBoundary($this->boundary[1]); |
2282 | 2281 | break; |
@@ -2284,50 +2283,50 @@ discard block |
||
2284 | 2283 | $body .= $mimepre; |
2285 | 2284 | $body .= $this->getBoundary($this->boundary[1], $altBodyCharSet, 'text/plain', $altBodyEncoding); |
2286 | 2285 | $body .= $this->encodeString($this->AltBody, $altBodyEncoding); |
2287 | - $body .= $this->LE . $this->LE; |
|
2288 | - $body .= $this->textLine('--' . $this->boundary[1]); |
|
2286 | + $body .= $this->LE.$this->LE; |
|
2287 | + $body .= $this->textLine('--'.$this->boundary[1]); |
|
2289 | 2288 | $body .= $this->headerLine('Content-Type', 'multipart/related;'); |
2290 | - $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); |
|
2289 | + $body .= $this->textLine("\tboundary=\"".$this->boundary[2].'"'); |
|
2291 | 2290 | $body .= $this->LE; |
2292 | 2291 | $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, 'text/html', $bodyEncoding); |
2293 | 2292 | $body .= $this->encodeString($this->Body, $bodyEncoding); |
2294 | - $body .= $this->LE . $this->LE; |
|
2293 | + $body .= $this->LE.$this->LE; |
|
2295 | 2294 | $body .= $this->attachAll('inline', $this->boundary[2]); |
2296 | 2295 | $body .= $this->LE; |
2297 | 2296 | $body .= $this->endBoundary($this->boundary[1]); |
2298 | 2297 | break; |
2299 | 2298 | case 'alt_attach': |
2300 | 2299 | $body .= $mimepre; |
2301 | - $body .= $this->textLine('--' . $this->boundary[1]); |
|
2300 | + $body .= $this->textLine('--'.$this->boundary[1]); |
|
2302 | 2301 | $body .= $this->headerLine('Content-Type', 'multipart/alternative;'); |
2303 | - $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); |
|
2302 | + $body .= $this->textLine("\tboundary=\"".$this->boundary[2].'"'); |
|
2304 | 2303 | $body .= $this->LE; |
2305 | 2304 | $body .= $this->getBoundary($this->boundary[2], $altBodyCharSet, 'text/plain', $altBodyEncoding); |
2306 | 2305 | $body .= $this->encodeString($this->AltBody, $altBodyEncoding); |
2307 | - $body .= $this->LE . $this->LE; |
|
2306 | + $body .= $this->LE.$this->LE; |
|
2308 | 2307 | $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, 'text/html', $bodyEncoding); |
2309 | 2308 | $body .= $this->encodeString($this->Body, $bodyEncoding); |
2310 | - $body .= $this->LE . $this->LE; |
|
2309 | + $body .= $this->LE.$this->LE; |
|
2311 | 2310 | $body .= $this->endBoundary($this->boundary[2]); |
2312 | 2311 | $body .= $this->LE; |
2313 | 2312 | $body .= $this->attachAll('attachment', $this->boundary[1]); |
2314 | 2313 | break; |
2315 | 2314 | case 'alt_inline_attach': |
2316 | 2315 | $body .= $mimepre; |
2317 | - $body .= $this->textLine('--' . $this->boundary[1]); |
|
2316 | + $body .= $this->textLine('--'.$this->boundary[1]); |
|
2318 | 2317 | $body .= $this->headerLine('Content-Type', 'multipart/alternative;'); |
2319 | - $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); |
|
2318 | + $body .= $this->textLine("\tboundary=\"".$this->boundary[2].'"'); |
|
2320 | 2319 | $body .= $this->LE; |
2321 | 2320 | $body .= $this->getBoundary($this->boundary[2], $altBodyCharSet, 'text/plain', $altBodyEncoding); |
2322 | 2321 | $body .= $this->encodeString($this->AltBody, $altBodyEncoding); |
2323 | - $body .= $this->LE . $this->LE; |
|
2324 | - $body .= $this->textLine('--' . $this->boundary[2]); |
|
2322 | + $body .= $this->LE.$this->LE; |
|
2323 | + $body .= $this->textLine('--'.$this->boundary[2]); |
|
2325 | 2324 | $body .= $this->headerLine('Content-Type', 'multipart/related;'); |
2326 | - $body .= $this->textLine("\tboundary=\"" . $this->boundary[3] . '"'); |
|
2325 | + $body .= $this->textLine("\tboundary=\"".$this->boundary[3].'"'); |
|
2327 | 2326 | $body .= $this->LE; |
2328 | 2327 | $body .= $this->getBoundary($this->boundary[3], $bodyCharSet, 'text/html', $bodyEncoding); |
2329 | 2328 | $body .= $this->encodeString($this->Body, $bodyEncoding); |
2330 | - $body .= $this->LE . $this->LE; |
|
2329 | + $body .= $this->LE.$this->LE; |
|
2331 | 2330 | $body .= $this->attachAll('inline', $this->boundary[3]); |
2332 | 2331 | $body .= $this->LE; |
2333 | 2332 | $body .= $this->endBoundary($this->boundary[2]); |
@@ -2347,12 +2346,12 @@ discard block |
||
2347 | 2346 | } elseif ($this->sign_key_file) { |
2348 | 2347 | try { |
2349 | 2348 | if (!defined('PKCS7_TEXT')) { |
2350 | - throw new phpmailerException($this->lang('extension_missing') . 'openssl'); |
|
2349 | + throw new phpmailerException($this->lang('extension_missing').'openssl'); |
|
2351 | 2350 | } |
2352 | 2351 | // @TODO would be nice to use php://temp streams here, but need to wrap for PHP < 5.1 |
2353 | 2352 | $file = tempnam(sys_get_temp_dir(), 'mail'); |
2354 | 2353 | if (false === file_put_contents($file, $body)) { |
2355 | - throw new phpmailerException($this->lang('signing') . ' Could not write temp file'); |
|
2354 | + throw new phpmailerException($this->lang('signing').' Could not write temp file'); |
|
2356 | 2355 | } |
2357 | 2356 | $signed = tempnam(sys_get_temp_dir(), 'signed'); |
2358 | 2357 | //Workaround for PHP bug https://bugs.php.net/bug.php?id=69197 |
@@ -2360,16 +2359,16 @@ discard block |
||
2360 | 2359 | $sign = @openssl_pkcs7_sign( |
2361 | 2360 | $file, |
2362 | 2361 | $signed, |
2363 | - 'file://' . realpath($this->sign_cert_file), |
|
2364 | - array('file://' . realpath($this->sign_key_file), $this->sign_key_pass), |
|
2362 | + 'file://'.realpath($this->sign_cert_file), |
|
2363 | + array('file://'.realpath($this->sign_key_file), $this->sign_key_pass), |
|
2365 | 2364 | null |
2366 | 2365 | ); |
2367 | 2366 | } else { |
2368 | 2367 | $sign = @openssl_pkcs7_sign( |
2369 | 2368 | $file, |
2370 | 2369 | $signed, |
2371 | - 'file://' . realpath($this->sign_cert_file), |
|
2372 | - array('file://' . realpath($this->sign_key_file), $this->sign_key_pass), |
|
2370 | + 'file://'.realpath($this->sign_cert_file), |
|
2371 | + array('file://'.realpath($this->sign_key_file), $this->sign_key_pass), |
|
2373 | 2372 | null, |
2374 | 2373 | PKCS7_DETACHED, |
2375 | 2374 | $this->sign_extracerts_file |
@@ -2381,12 +2380,12 @@ discard block |
||
2381 | 2380 | @unlink($signed); |
2382 | 2381 | //The message returned by openssl contains both headers and body, so need to split them up |
2383 | 2382 | $parts = explode("\n\n", $body, 2); |
2384 | - $this->MIMEHeader .= $parts[0] . $this->LE . $this->LE; |
|
2383 | + $this->MIMEHeader .= $parts[0].$this->LE.$this->LE; |
|
2385 | 2384 | $body = $parts[1]; |
2386 | 2385 | } else { |
2387 | 2386 | @unlink($file); |
2388 | 2387 | @unlink($signed); |
2389 | - throw new phpmailerException($this->lang('signing') . openssl_error_string()); |
|
2388 | + throw new phpmailerException($this->lang('signing').openssl_error_string()); |
|
2390 | 2389 | } |
2391 | 2390 | } catch (phpmailerException $exc) { |
2392 | 2391 | $body = ''; |
@@ -2419,7 +2418,7 @@ discard block |
||
2419 | 2418 | if ($encoding == '') { |
2420 | 2419 | $encoding = $this->Encoding; |
2421 | 2420 | } |
2422 | - $result .= $this->textLine('--' . $boundary); |
|
2421 | + $result .= $this->textLine('--'.$boundary); |
|
2423 | 2422 | $result .= sprintf('Content-Type: %s; charset=%s', $contentType, $charSet); |
2424 | 2423 | $result .= $this->LE; |
2425 | 2424 | // RFC1341 part 5 says 7bit is assumed if not specified |
@@ -2439,7 +2438,7 @@ discard block |
||
2439 | 2438 | */ |
2440 | 2439 | protected function endBoundary($boundary) |
2441 | 2440 | { |
2442 | - return $this->LE . '--' . $boundary . '--' . $this->LE; |
|
2441 | + return $this->LE.'--'.$boundary.'--'.$this->LE; |
|
2443 | 2442 | } |
2444 | 2443 | |
2445 | 2444 | /** |
@@ -2476,7 +2475,7 @@ discard block |
||
2476 | 2475 | */ |
2477 | 2476 | public function headerLine($name, $value) |
2478 | 2477 | { |
2479 | - return $name . ': ' . $value . $this->LE; |
|
2478 | + return $name.': '.$value.$this->LE; |
|
2480 | 2479 | } |
2481 | 2480 | |
2482 | 2481 | /** |
@@ -2487,7 +2486,7 @@ discard block |
||
2487 | 2486 | */ |
2488 | 2487 | public function textLine($value) |
2489 | 2488 | { |
2490 | - return $value . $this->LE; |
|
2489 | + return $value.$this->LE; |
|
2491 | 2490 | } |
2492 | 2491 | |
2493 | 2492 | /** |
@@ -2505,7 +2504,7 @@ discard block |
||
2505 | 2504 | { |
2506 | 2505 | try { |
2507 | 2506 | if (!@is_file($path)) { |
2508 | - throw new phpmailerException($this->lang('file_access') . $path, self::STOP_CONTINUE); |
|
2507 | + throw new phpmailerException($this->lang('file_access').$path, self::STOP_CONTINUE); |
|
2509 | 2508 | } |
2510 | 2509 | |
2511 | 2510 | // If a MIME type is not specified, try to work it out from the file name |
@@ -2629,7 +2628,7 @@ discard block |
||
2629 | 2628 | 'Content-Disposition: %s; filename="%s"%s', |
2630 | 2629 | $disposition, |
2631 | 2630 | $encoded_name, |
2632 | - $this->LE . $this->LE |
|
2631 | + $this->LE.$this->LE |
|
2633 | 2632 | ); |
2634 | 2633 | } else { |
2635 | 2634 | if (!empty($encoded_name)) { |
@@ -2637,13 +2636,13 @@ discard block |
||
2637 | 2636 | 'Content-Disposition: %s; filename=%s%s', |
2638 | 2637 | $disposition, |
2639 | 2638 | $encoded_name, |
2640 | - $this->LE . $this->LE |
|
2639 | + $this->LE.$this->LE |
|
2641 | 2640 | ); |
2642 | 2641 | } else { |
2643 | 2642 | $mime[] = sprintf( |
2644 | 2643 | 'Content-Disposition: %s%s', |
2645 | 2644 | $disposition, |
2646 | - $this->LE . $this->LE |
|
2645 | + $this->LE.$this->LE |
|
2647 | 2646 | ); |
2648 | 2647 | } |
2649 | 2648 | } |
@@ -2657,13 +2656,13 @@ discard block |
||
2657 | 2656 | if ($this->isError()) { |
2658 | 2657 | return ''; |
2659 | 2658 | } |
2660 | - $mime[] = $this->LE . $this->LE; |
|
2659 | + $mime[] = $this->LE.$this->LE; |
|
2661 | 2660 | } else { |
2662 | 2661 | $mime[] = $this->encodeFile($path, $encoding); |
2663 | 2662 | if ($this->isError()) { |
2664 | 2663 | return ''; |
2665 | 2664 | } |
2666 | - $mime[] = $this->LE . $this->LE; |
|
2665 | + $mime[] = $this->LE.$this->LE; |
|
2667 | 2666 | } |
2668 | 2667 | } |
2669 | 2668 | } |
@@ -2686,7 +2685,7 @@ discard block |
||
2686 | 2685 | { |
2687 | 2686 | try { |
2688 | 2687 | if (!is_readable($path)) { |
2689 | - throw new phpmailerException($this->lang('file_open') . $path, self::STOP_CONTINUE); |
|
2688 | + throw new phpmailerException($this->lang('file_open').$path, self::STOP_CONTINUE); |
|
2690 | 2689 | } |
2691 | 2690 | $magic_quotes = get_magic_quotes_runtime(); |
2692 | 2691 | if ($magic_quotes) { |
@@ -2745,7 +2744,7 @@ discard block |
||
2745 | 2744 | $encoded = $this->encodeQP($str); |
2746 | 2745 | break; |
2747 | 2746 | default: |
2748 | - $this->setError($this->lang('encoding') . $encoding); |
|
2747 | + $this->setError($this->lang('encoding').$encoding); |
|
2749 | 2748 | break; |
2750 | 2749 | } |
2751 | 2750 | return $encoded; |
@@ -2792,7 +2791,7 @@ discard block |
||
2792 | 2791 | |
2793 | 2792 | $maxlen = 75 - 7 - strlen($this->CharSet); |
2794 | 2793 | // Try to select the encoding which should produce the shortest output |
2795 | - if ($matchcount > strlen($str) / 3) { |
|
2794 | + if ($matchcount > strlen($str)/3) { |
|
2796 | 2795 | // More than a third of the content will need encoding, so B encoding will be most efficient |
2797 | 2796 | $encoding = 'B'; |
2798 | 2797 | if (function_exists('mb_strlen') && $this->hasMultiBytes($str)) { |
@@ -2801,17 +2800,17 @@ discard block |
||
2801 | 2800 | $encoded = $this->base64EncodeWrapMB($str, "\n"); |
2802 | 2801 | } else { |
2803 | 2802 | $encoded = base64_encode($str); |
2804 | - $maxlen -= $maxlen % 4; |
|
2803 | + $maxlen -= $maxlen%4; |
|
2805 | 2804 | $encoded = trim(chunk_split($encoded, $maxlen, "\n")); |
2806 | 2805 | } |
2807 | 2806 | } else { |
2808 | 2807 | $encoding = 'Q'; |
2809 | 2808 | $encoded = $this->encodeQ($str, $position); |
2810 | 2809 | $encoded = $this->wrapText($encoded, $maxlen, true); |
2811 | - $encoded = str_replace('=' . self::CRLF, "\n", trim($encoded)); |
|
2810 | + $encoded = str_replace('='.self::CRLF, "\n", trim($encoded)); |
|
2812 | 2811 | } |
2813 | 2812 | |
2814 | - $encoded = preg_replace('/^(.*)$/m', ' =?' . $this->CharSet . "?$encoding?\\1?=", $encoded); |
|
2813 | + $encoded = preg_replace('/^(.*)$/m', ' =?'.$this->CharSet."?$encoding?\\1?=", $encoded); |
|
2815 | 2814 | $encoded = trim(str_replace("\n", $this->LE, $encoded)); |
2816 | 2815 | |
2817 | 2816 | return $encoded; |
@@ -2854,7 +2853,7 @@ discard block |
||
2854 | 2853 | */ |
2855 | 2854 | public function base64EncodeWrapMB($str, $linebreak = null) |
2856 | 2855 | { |
2857 | - $start = '=?' . $this->CharSet . '?B?'; |
|
2856 | + $start = '=?'.$this->CharSet.'?B?'; |
|
2858 | 2857 | $end = '?='; |
2859 | 2858 | $encoded = ''; |
2860 | 2859 | if ($linebreak === null) { |
@@ -2865,9 +2864,9 @@ discard block |
||
2865 | 2864 | // Each line must have length <= 75, including $start and $end |
2866 | 2865 | $length = 75 - strlen($start) - strlen($end); |
2867 | 2866 | // Average multi-byte ratio |
2868 | - $ratio = $mb_length / strlen($str); |
|
2867 | + $ratio = $mb_length/strlen($str); |
|
2869 | 2868 | // Base64 has a 4:3 ratio |
2870 | - $avgLength = floor($length * $ratio * .75); |
|
2869 | + $avgLength = floor($length*$ratio*.75); |
|
2871 | 2870 | |
2872 | 2871 | for ($i = 0; $i < $mb_length; $i += $offset) { |
2873 | 2872 | $lookBack = 0; |
@@ -2877,7 +2876,7 @@ discard block |
||
2877 | 2876 | $chunk = base64_encode($chunk); |
2878 | 2877 | $lookBack++; |
2879 | 2878 | } while (strlen($chunk) > $length); |
2880 | - $encoded .= $chunk . $linebreak; |
|
2879 | + $encoded .= $chunk.$linebreak; |
|
2881 | 2880 | } |
2882 | 2881 | |
2883 | 2882 | // Chomp the last linefeed |
@@ -2906,7 +2905,7 @@ discard block |
||
2906 | 2905 | array(' ', "\r\n=2E", "\r\n", '='), |
2907 | 2906 | rawurlencode($string) |
2908 | 2907 | ); |
2909 | - return preg_replace('/[^\r\n]{' . ($line_max - 3) . '}[^=\r\n]{2}/', "$0=\r\n", $string); |
|
2908 | + return preg_replace('/[^\r\n]{'.($line_max - 3).'}[^=\r\n]{2}/', "$0=\r\n", $string); |
|
2910 | 2909 | } |
2911 | 2910 | |
2912 | 2911 | /** |
@@ -2955,7 +2954,7 @@ discard block |
||
2955 | 2954 | default: |
2956 | 2955 | // RFC 2047 section 5.1 |
2957 | 2956 | // Replace every high ascii, control, =, ? and _ characters |
2958 | - $pattern = '\000-\011\013\014\016-\037\075\077\137\177-\377' . $pattern; |
|
2957 | + $pattern = '\000-\011\013\014\016-\037\075\077\137\177-\377'.$pattern; |
|
2959 | 2958 | break; |
2960 | 2959 | } |
2961 | 2960 | $matches = array(); |
@@ -2968,7 +2967,7 @@ discard block |
||
2968 | 2967 | array_unshift($matches[0], '='); |
2969 | 2968 | } |
2970 | 2969 | foreach (array_unique($matches[0]) as $char) { |
2971 | - $encoded = str_replace($char, '=' . sprintf('%02X', ord($char)), $encoded); |
|
2970 | + $encoded = str_replace($char, '='.sprintf('%02X', ord($char)), $encoded); |
|
2972 | 2971 | } |
2973 | 2972 | } |
2974 | 2973 | // Replace every spaces to _ (more readable than =20) |
@@ -3029,7 +3028,7 @@ discard block |
||
3029 | 3028 | public function addEmbeddedImage($path, $cid, $name = '', $encoding = 'base64', $type = '', $disposition = 'inline') |
3030 | 3029 | { |
3031 | 3030 | if (!@is_file($path)) { |
3032 | - $this->setError($this->lang('file_access') . $path); |
|
3031 | + $this->setError($this->lang('file_access').$path); |
|
3033 | 3032 | return false; |
3034 | 3033 | } |
3035 | 3034 | |
@@ -3244,15 +3243,15 @@ discard block |
||
3244 | 3243 | if ($this->Mailer == 'smtp' and !is_null($this->smtp)) { |
3245 | 3244 | $lasterror = $this->smtp->getError(); |
3246 | 3245 | if (!empty($lasterror['error'])) { |
3247 | - $msg .= $this->lang('smtp_error') . $lasterror['error']; |
|
3246 | + $msg .= $this->lang('smtp_error').$lasterror['error']; |
|
3248 | 3247 | if (!empty($lasterror['detail'])) { |
3249 | - $msg .= ' Detail: '. $lasterror['detail']; |
|
3248 | + $msg .= ' Detail: '.$lasterror['detail']; |
|
3250 | 3249 | } |
3251 | 3250 | if (!empty($lasterror['smtp_code'])) { |
3252 | - $msg .= ' SMTP code: ' . $lasterror['smtp_code']; |
|
3251 | + $msg .= ' SMTP code: '.$lasterror['smtp_code']; |
|
3253 | 3252 | } |
3254 | 3253 | if (!empty($lasterror['smtp_code_ex'])) { |
3255 | - $msg .= ' Additional SMTP info: ' . $lasterror['smtp_code_ex']; |
|
3254 | + $msg .= ' Additional SMTP info: '.$lasterror['smtp_code_ex']; |
|
3256 | 3255 | } |
3257 | 3256 | } |
3258 | 3257 | } |
@@ -3311,7 +3310,7 @@ discard block |
||
3311 | 3310 | //Include a link to troubleshooting docs on SMTP connection failure |
3312 | 3311 | //this is by far the biggest cause of support questions |
3313 | 3312 | //but it's usually not PHPMailer's fault. |
3314 | - return $this->language[$key] . ' https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting'; |
|
3313 | + return $this->language[$key].' https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting'; |
|
3315 | 3314 | } |
3316 | 3315 | return $this->language[$key]; |
3317 | 3316 | } else { |
@@ -3403,11 +3402,11 @@ discard block |
||
3403 | 3402 | } else { |
3404 | 3403 | $data = rawurldecode($data); |
3405 | 3404 | } |
3406 | - $cid = md5($url) . '@phpmailer.0'; // RFC2392 S 2 |
|
3407 | - if ($this->addStringEmbeddedImage($data, $cid, 'embed' . $imgindex, 'base64', $match[1])) { |
|
3405 | + $cid = md5($url).'@phpmailer.0'; // RFC2392 S 2 |
|
3406 | + if ($this->addStringEmbeddedImage($data, $cid, 'embed'.$imgindex, 'base64', $match[1])) { |
|
3408 | 3407 | $message = str_replace( |
3409 | 3408 | $images[0][$imgindex], |
3410 | - $images[1][$imgindex] . '="cid:' . $cid . '"', |
|
3409 | + $images[1][$imgindex].'="cid:'.$cid.'"', |
|
3411 | 3410 | $message |
3412 | 3411 | ); |
3413 | 3412 | } |
@@ -3419,7 +3418,7 @@ discard block |
||
3419 | 3418 | if ($directory == '.') { |
3420 | 3419 | $directory = ''; |
3421 | 3420 | } |
3422 | - $cid = md5($url) . '@phpmailer.0'; // RFC2392 S 2 |
|
3421 | + $cid = md5($url).'@phpmailer.0'; // RFC2392 S 2 |
|
3423 | 3422 | if (strlen($basedir) > 1 && substr($basedir, -1) != '/') { |
3424 | 3423 | $basedir .= '/'; |
3425 | 3424 | } |
@@ -3427,7 +3426,7 @@ discard block |
||
3427 | 3426 | $directory .= '/'; |
3428 | 3427 | } |
3429 | 3428 | if ($this->addEmbeddedImage( |
3430 | - $basedir . $directory . $filename, |
|
3429 | + $basedir.$directory.$filename, |
|
3431 | 3430 | $cid, |
3432 | 3431 | $filename, |
3433 | 3432 | 'base64', |
@@ -3435,8 +3434,8 @@ discard block |
||
3435 | 3434 | ) |
3436 | 3435 | ) { |
3437 | 3436 | $message = preg_replace( |
3438 | - '/' . $images[1][$imgindex] . '=["\']' . preg_quote($url, '/') . '["\']/Ui', |
|
3439 | - $images[1][$imgindex] . '="cid:' . $cid . '"', |
|
3437 | + '/'.$images[1][$imgindex].'=["\']'.preg_quote($url, '/').'["\']/Ui', |
|
3438 | + $images[1][$imgindex].'="cid:'.$cid.'"', |
|
3440 | 3439 | $message |
3441 | 3440 | ); |
3442 | 3441 | } |
@@ -3448,8 +3447,8 @@ discard block |
||
3448 | 3447 | $this->Body = $this->normalizeBreaks($message); |
3449 | 3448 | $this->AltBody = $this->normalizeBreaks($this->html2text($message, $advanced)); |
3450 | 3449 | if (!$this->alternativeExists()) { |
3451 | - $this->AltBody = 'To view this email message, open it in a program that understands HTML!' . |
|
3452 | - self::CRLF . self::CRLF; |
|
3450 | + $this->AltBody = 'To view this email message, open it in a program that understands HTML!'. |
|
3451 | + self::CRLF.self::CRLF; |
|
3453 | 3452 | } |
3454 | 3453 | return $this->Body; |
3455 | 3454 | } |
@@ -3686,7 +3685,7 @@ discard block |
||
3686 | 3685 | $this->$name = $value; |
3687 | 3686 | return true; |
3688 | 3687 | } else { |
3689 | - $this->setError($this->lang('variable_set') . $name); |
|
3688 | + $this->setError($this->lang('variable_set').$name); |
|
3690 | 3689 | return false; |
3691 | 3690 | } |
3692 | 3691 | } |
@@ -3747,7 +3746,7 @@ discard block |
||
3747 | 3746 | if (((0x21 <= $ord) && ($ord <= 0x3A)) || $ord == 0x3C || ((0x3E <= $ord) && ($ord <= 0x7E))) { |
3748 | 3747 | $line .= $txt[$i]; |
3749 | 3748 | } else { |
3750 | - $line .= '=' . sprintf('%02X', $ord); |
|
3749 | + $line .= '='.sprintf('%02X', $ord); |
|
3751 | 3750 | } |
3752 | 3751 | } |
3753 | 3752 | return $line; |
@@ -3764,7 +3763,7 @@ discard block |
||
3764 | 3763 | { |
3765 | 3764 | if (!defined('PKCS7_TEXT')) { |
3766 | 3765 | if ($this->exceptions) { |
3767 | - throw new phpmailerException($this->lang('extension_missing') . 'openssl'); |
|
3766 | + throw new phpmailerException($this->lang('extension_missing').'openssl'); |
|
3768 | 3767 | } |
3769 | 3768 | return ''; |
3770 | 3769 | } |
@@ -3787,9 +3786,9 @@ discard block |
||
3787 | 3786 | $hash = hash('sha256', $signHeader); |
3788 | 3787 | //'Magic' constant for SHA256 from RFC3447 |
3789 | 3788 | //@link https://tools.ietf.org/html/rfc3447#page-43 |
3790 | - $t = '3031300d060960864801650304020105000420' . $hash; |
|
3791 | - $pslen = $pinfo['bits'] / 8 - (strlen($t) / 2 + 3); |
|
3792 | - $eb = pack('H*', '0001' . str_repeat('FF', $pslen) . '00' . $t); |
|
3789 | + $t = '3031300d060960864801650304020105000420'.$hash; |
|
3790 | + $pslen = $pinfo['bits']/8 - (strlen($t)/2 + 3); |
|
3791 | + $eb = pack('H*', '0001'.str_repeat('FF', $pslen).'00'.$t); |
|
3793 | 3792 | |
3794 | 3793 | if (openssl_private_encrypt($eb, $signature, $privKey, OPENSSL_NO_PADDING)) { |
3795 | 3794 | openssl_pkey_free($privKey); |
@@ -3814,7 +3813,7 @@ discard block |
||
3814 | 3813 | list($heading, $value) = explode(':', $line, 2); |
3815 | 3814 | $heading = strtolower($heading); |
3816 | 3815 | $value = preg_replace('/\s{2,}/', ' ', $value); // Compress useless spaces |
3817 | - $lines[$key] = $heading . ':' . trim($value); // Don't forget to remove WSP around the value |
|
3816 | + $lines[$key] = $heading.':'.trim($value); // Don't forget to remove WSP around the value |
|
3818 | 3817 | } |
3819 | 3818 | $signHeader = implode("\r\n", $lines); |
3820 | 3819 | return $signHeader; |
@@ -3893,32 +3892,32 @@ discard block |
||
3893 | 3892 | if ('' == $this->DKIM_identity) { |
3894 | 3893 | $ident = ''; |
3895 | 3894 | } else { |
3896 | - $ident = ' i=' . $this->DKIM_identity . ';'; |
|
3897 | - } |
|
3898 | - $dkimhdrs = 'DKIM-Signature: v=1; a=' . |
|
3899 | - $DKIMsignatureType . '; q=' . |
|
3900 | - $DKIMquery . '; l=' . |
|
3901 | - $DKIMlen . '; s=' . |
|
3902 | - $this->DKIM_selector . |
|
3903 | - ";\r\n" . |
|
3904 | - "\tt=" . $DKIMtime . '; c=' . $DKIMcanonicalization . ";\r\n" . |
|
3905 | - "\th=From:To:Date:Subject;\r\n" . |
|
3906 | - "\td=" . $this->DKIM_domain . ';' . $ident . "\r\n" . |
|
3907 | - "\tz=$from\r\n" . |
|
3908 | - "\t|$to\r\n" . |
|
3909 | - "\t|$date\r\n" . |
|
3910 | - "\t|$subject;\r\n" . |
|
3911 | - "\tbh=" . $DKIMb64 . ";\r\n" . |
|
3895 | + $ident = ' i='.$this->DKIM_identity.';'; |
|
3896 | + } |
|
3897 | + $dkimhdrs = 'DKIM-Signature: v=1; a='. |
|
3898 | + $DKIMsignatureType.'; q='. |
|
3899 | + $DKIMquery.'; l='. |
|
3900 | + $DKIMlen.'; s='. |
|
3901 | + $this->DKIM_selector. |
|
3902 | + ";\r\n". |
|
3903 | + "\tt=".$DKIMtime.'; c='.$DKIMcanonicalization.";\r\n". |
|
3904 | + "\th=From:To:Date:Subject;\r\n". |
|
3905 | + "\td=".$this->DKIM_domain.';'.$ident."\r\n". |
|
3906 | + "\tz=$from\r\n". |
|
3907 | + "\t|$to\r\n". |
|
3908 | + "\t|$date\r\n". |
|
3909 | + "\t|$subject;\r\n". |
|
3910 | + "\tbh=".$DKIMb64.";\r\n". |
|
3912 | 3911 | "\tb="; |
3913 | 3912 | $toSign = $this->DKIM_HeaderC( |
3914 | - $from_header . "\r\n" . |
|
3915 | - $to_header . "\r\n" . |
|
3916 | - $date_header . "\r\n" . |
|
3917 | - $subject_header . "\r\n" . |
|
3913 | + $from_header."\r\n". |
|
3914 | + $to_header."\r\n". |
|
3915 | + $date_header."\r\n". |
|
3916 | + $subject_header."\r\n". |
|
3918 | 3917 | $dkimhdrs |
3919 | 3918 | ); |
3920 | 3919 | $signed = $this->DKIM_Sign($toSign); |
3921 | - return $dkimhdrs . $signed . "\r\n"; |
|
3920 | + return $dkimhdrs.$signed."\r\n"; |
|
3922 | 3921 | } |
3923 | 3922 | |
3924 | 3923 | /** |
@@ -4019,7 +4018,7 @@ discard block |
||
4019 | 4018 | */ |
4020 | 4019 | public function errorMessage() |
4021 | 4020 | { |
4022 | - $errorMsg = '<strong>' . $this->getMessage() . "</strong><br />\n"; |
|
4021 | + $errorMsg = '<strong>'.$this->getMessage()."</strong><br />\n"; |
|
4023 | 4022 | return $errorMsg; |
4024 | 4023 | } |
4025 | 4024 | } |