Skip to content
Browse files

Replacing more references to o_base_url. This shouldnt have any effec…

…t, but for consistency sake it is bad to reference it directly in some places and via the wrapper in others.
  • Loading branch information...
1 parent e317194 commit c7be20ecd0474b0242ae366f12c203c0c0f360f1 @reines reines committed Oct 23, 2010
Showing with 28 additions and 28 deletions.
  1. +1 −1 db_update.php
  2. +3 −3 include/functions.php
  3. +3 −3 login.php
  4. +2 −2 misc.php
  5. +9 −9 post.php
  6. +4 −4 profile.php
  7. +6 −6 register.php
View
2 db_update.php
@@ -1466,7 +1466,7 @@ function _error_users($cur_user)
$mail_message = trim(substr($mail_tpl, $first_crlf));
$mail_subject = str_replace('<board_title>', $pun_config['o_board_title'], $mail_subject);
- $mail_message = str_replace('<base_url>', $pun_config['o_base_url'].'/', $mail_message);
+ $mail_message = str_replace('<base_url>', get_base_url().'/', $mail_message);
$mail_message = str_replace('<old_username>', $old_username, $mail_message);
$mail_message = str_replace('<new_username>', $username, $mail_message);
$mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'].' Mailer', $mail_message);
View
6 include/functions.php
@@ -1034,7 +1034,7 @@ function file_get_contents($filename, $use_include_path = 0)
//
-// Make sure that HTTP_REFERER matches $pun_config['o_base_url']/$script
+// Make sure that HTTP_REFERER matches base_url/script
//
function confirm_referrer($script, $error_msg = false)
{
@@ -1049,7 +1049,7 @@ function confirm_referrer($script, $error_msg = false)
if (strpos($referrer['host'], 'www.') === 0)
$referrer['host'] = substr($referrer['host'], 4);
- $valid = parse_url(strtolower($pun_config['o_base_url'].'/'.$script));
+ $valid = parse_url(strtolower(get_base_url().'/'.$script));
// Remove www subdomain if it exists
if (strpos($valid['host'], 'www.') === 0)
$valid['host'] = substr($valid['host'], 4);
@@ -1533,7 +1533,7 @@ function redirect($destination_url, $message)
{
global $db, $pun_config, $lang_common, $pun_user;
- // Prefix with o_base_url (unless there's already a valid URI)
+ // Prefix with base_url (unless there's already a valid URI)
if (strpos($destination_url, 'http://') !== 0 && strpos($destination_url, 'https://') !== 0 && strpos($destination_url, '/') !== 0)
$destination_url = get_base_url(true).'/'.$destination_url;
View
6 login.php
@@ -134,7 +134,7 @@
$mail_message = trim(substr($mail_tpl, $first_crlf));
// Do the generic replacements first (they apply to all emails sent out here)
- $mail_message = str_replace('<base_url>', $pun_config['o_base_url'].'/', $mail_message);
+ $mail_message = str_replace('<base_url>', get_base_url().'/', $mail_message);
$mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message);
// Loop through users we found
@@ -151,7 +151,7 @@
// Do the user specific replacements to the template
$cur_mail_message = str_replace('<username>', $cur_hit['username'], $mail_message);
- $cur_mail_message = str_replace('<activation_url>', $pun_config['o_base_url'].'/profile.php?id='.$cur_hit['id'].'&action=change_pass&key='.$new_password_key, $cur_mail_message);
+ $cur_mail_message = str_replace('<activation_url>', get_base_url().'/profile.php?id='.$cur_hit['id'].'&action=change_pass&key='.$new_password_key, $cur_mail_message);
$cur_mail_message = str_replace('<new_password>', $new_password, $cur_mail_message);
pun_mail($email, $mail_subject, $cur_mail_message);
@@ -230,7 +230,7 @@
if (strpos($referrer['host'], 'www.') === 0)
$referrer['host'] = substr($referrer['host'], 4);
- $valid = parse_url($pun_config['o_base_url']);
+ $valid = parse_url(get_base_url());
// Remove www subdomain if it exists
if (strpos($valid['host'], 'www.') === 0)
$valid['host'] = substr($valid['host'], 4);
View
4 misc.php
@@ -145,7 +145,7 @@
if (strpos($referrer['host'], 'www.') === 0)
$referrer['host'] = substr($referrer['host'], 4);
- $valid = parse_url($pun_config['o_base_url']);
+ $valid = parse_url(get_base_url());
// Remove www subdomain if it exists
if (strpos($valid['host'], 'www.') === 0)
$valid['host'] = substr($valid['host'], 4);
@@ -238,7 +238,7 @@
if ($pun_config['o_mailing_list'] != '')
{
$mail_subject = sprintf($lang_common['Report notification'], $forum_id, $subject);
- $mail_message = sprintf($lang_common['Report message 1'], $pun_user['username'], $pun_config['o_base_url'].'/viewtopic.php?pid='.$post_id.'#p'.$post_id)."\n";
+ $mail_message = sprintf($lang_common['Report message 1'], $pun_user['username'], get_base_url().'/viewtopic.php?pid='.$post_id.'#p'.$post_id)."\n";
$mail_message .= sprintf($lang_common['Report message 2'], $reason)."\n";
$mail_message .= "\n".'--'."\n".$lang_common['Email signature'];
View
18 post.php
@@ -229,16 +229,16 @@
$mail_subject = str_replace('<topic_subject>', '\''.$cur_posting['subject'].'\'', $mail_subject);
$mail_message = str_replace('<topic_subject>', '\''.$cur_posting['subject'].'\'', $mail_message);
$mail_message = str_replace('<replier>', $username, $mail_message);
- $mail_message = str_replace('<post_url>', $pun_config['o_base_url'].'/viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $mail_message);
- $mail_message = str_replace('<unsubscribe_url>', $pun_config['o_base_url'].'/misc.php?action=unsubscribe&tid='.$tid, $mail_message);
+ $mail_message = str_replace('<post_url>', get_base_url().'/viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $mail_message);
+ $mail_message = str_replace('<unsubscribe_url>', get_base_url().'/misc.php?action=unsubscribe&tid='.$tid, $mail_message);
$mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message);
$mail_subject_full = str_replace('<topic_subject>', '\''.$cur_posting['subject'].'\'', $mail_subject_full);
$mail_message_full = str_replace('<topic_subject>', '\''.$cur_posting['subject'].'\'', $mail_message_full);
$mail_message_full = str_replace('<replier>', $username, $mail_message_full);
$mail_message_full = str_replace('<message>', $message, $mail_message_full);
- $mail_message_full = str_replace('<post_url>', $pun_config['o_base_url'].'/viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $mail_message_full);
- $mail_message_full = str_replace('<unsubscribe_url>', $pun_config['o_base_url'].'/misc.php?action=unsubscribe&tid='.$tid, $mail_message_full);
+ $mail_message_full = str_replace('<post_url>', get_base_url().'/viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $mail_message_full);
+ $mail_message_full = str_replace('<unsubscribe_url>', get_base_url().'/misc.php?action=unsubscribe&tid='.$tid, $mail_message_full);
$mail_message_full = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message_full);
$notification_emails[$cur_subscriber['language']][0] = $mail_subject;
@@ -332,8 +332,8 @@
$mail_message = str_replace('<topic_subject>', '\''.$subject.'\'', $mail_message);
$mail_message = str_replace('<forum_name>', '\''.$cur_posting['forum_name'].'\'', $mail_message);
$mail_message = str_replace('<poster>', $username, $mail_message);
- $mail_message = str_replace('<topic_url>', $pun_config['o_base_url'].'/viewtopic.php?id='.$new_tid, $mail_message);
- $mail_message = str_replace('<unsubscribe_url>', $pun_config['o_base_url'].'/misc.php?action=unsubscribe&fid='.$cur_posting['id'], $mail_message);
+ $mail_message = str_replace('<topic_url>', get_base_url().'/viewtopic.php?id='.$new_tid, $mail_message);
+ $mail_message = str_replace('<unsubscribe_url>', get_base_url().'/misc.php?action=unsubscribe&fid='.$cur_posting['id'], $mail_message);
$mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message);
$mail_subject_full = str_replace('<topic_subject>', '\''.$subject.'\'', $mail_subject_full);
@@ -342,8 +342,8 @@
$mail_message_full = str_replace('<forum_name>', '\''.$cur_posting['forum_name'].'\'', $mail_message_full);
$mail_message_full = str_replace('<poster>', $username, $mail_message_full);
$mail_message_full = str_replace('<message>', $message, $mail_message_full);
- $mail_message_full = str_replace('<topic_url>', $pun_config['o_base_url'].'/viewtopic.php?id='.$new_tid, $mail_message_full);
- $mail_message_full = str_replace('<unsubscribe_url>', $pun_config['o_base_url'].'/misc.php?action=unsubscribe&fid='.$cur_posting['id'], $mail_message_full);
+ $mail_message_full = str_replace('<topic_url>', get_base_url().'/viewtopic.php?id='.$new_tid, $mail_message_full);
+ $mail_message_full = str_replace('<unsubscribe_url>', get_base_url().'/misc.php?action=unsubscribe&fid='.$cur_posting['id'], $mail_message_full);
$mail_message_full = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message_full);
$notification_emails[$cur_subscriber['language']][0] = $mail_subject;
@@ -373,7 +373,7 @@
{
$mail_subject = $lang_common['Banned email notification'];
$mail_message = sprintf($lang_common['Banned email post message'], $username, $email)."\n";
- $mail_message .= sprintf($lang_common['Post URL'], $pun_config['o_base_url'].'/viewtopic.php?pid='.$new_pid.'#p'.$new_pid)."\n";
+ $mail_message .= sprintf($lang_common['Post URL'], get_base_url().'/viewtopic.php?pid='.$new_pid.'#p'.$new_pid)."\n";
$mail_message .= "\n".'--'."\n".$lang_common['Email signature'];
pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
View
8 profile.php
@@ -212,7 +212,7 @@
{
$mail_subject = $lang_common['Banned email notification'];
$mail_message = sprintf($lang_common['Banned email change message'], $pun_user['username'], $new_email)."\n";
- $mail_message .= sprintf($lang_common['User profile'], $pun_config['o_base_url'].'/profile.php?id='.$id)."\n";
+ $mail_message .= sprintf($lang_common['User profile'], get_base_url().'/profile.php?id='.$id)."\n";
$mail_message .= "\n".'--'."\n".$lang_common['Email signature'];
pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
@@ -232,7 +232,7 @@
$mail_subject = $lang_common['Duplicate email notification'];
$mail_message = sprintf($lang_common['Duplicate email change message'], $pun_user['username'], implode(', ', $dupe_list))."\n";
- $mail_message .= sprintf($lang_common['User profile'], $pun_config['o_base_url'].'/profile.php?id='.$id)."\n";
+ $mail_message .= sprintf($lang_common['User profile'], get_base_url().'/profile.php?id='.$id)."\n";
$mail_message .= "\n".'--'."\n".$lang_common['Email signature'];
pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
@@ -253,8 +253,8 @@
$mail_message = trim(substr($mail_tpl, $first_crlf));
$mail_message = str_replace('<username>', $pun_user['username'], $mail_message);
- $mail_message = str_replace('<base_url>', $pun_config['o_base_url'], $mail_message);
- $mail_message = str_replace('<activation_url>', $pun_config['o_base_url'].'/profile.php?action=change_email&id='.$id.'&key='.$new_email_key, $mail_message);
+ $mail_message = str_replace('<base_url>', get_base_url(), $mail_message);
+ $mail_message = str_replace('<activation_url>', get_base_url().'/profile.php?action=change_email&id='.$id.'&key='.$new_email_key, $mail_message);
$mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message);
pun_mail($new_email, $mail_subject, $mail_message);
View
12 register.php
@@ -167,7 +167,7 @@
{
$mail_subject = $lang_common['Banned email notification'];
$mail_message = sprintf($lang_common['Banned email register message'], $username, $email1)."\n";
- $mail_message .= sprintf($lang_common['User profile'], $pun_config['o_base_url'].'/profile.php?id='.$new_uid)."\n";
+ $mail_message .= sprintf($lang_common['User profile'], get_base_url().'/profile.php?id='.$new_uid)."\n";
$mail_message .= "\n".'--'."\n".$lang_common['Email signature'];
pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
@@ -178,7 +178,7 @@
{
$mail_subject = $lang_common['Duplicate email notification'];
$mail_message = sprintf($lang_common['Duplicate email register message'], $username, implode(', ', $dupe_list))."\n";
- $mail_message .= sprintf($lang_common['User profile'], $pun_config['o_base_url'].'/profile.php?id='.$new_uid)."\n";
+ $mail_message .= sprintf($lang_common['User profile'], get_base_url().'/profile.php?id='.$new_uid)."\n";
$mail_message .= "\n".'--'."\n".$lang_common['Email signature'];
pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
@@ -188,8 +188,8 @@
if ($pun_config['o_regs_report'] == '1')
{
$mail_subject = $lang_common['New user notification'];
- $mail_message = sprintf($lang_common['New user message'], $username, $pun_config['o_base_url'].'/')."\n";
- $mail_message .= sprintf($lang_common['User profile'], $pun_config['o_base_url'].'/profile.php?id='.$new_uid)."\n";
+ $mail_message = sprintf($lang_common['New user message'], $username, get_base_url().'/')."\n";
+ $mail_message .= sprintf($lang_common['User profile'], get_base_url().'/profile.php?id='.$new_uid)."\n";
$mail_message .= "\n".'--'."\n".$lang_common['Email signature'];
pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
@@ -208,10 +208,10 @@
$mail_message = trim(substr($mail_tpl, $first_crlf));
$mail_subject = str_replace('<board_title>', $pun_config['o_board_title'], $mail_subject);
- $mail_message = str_replace('<base_url>', $pun_config['o_base_url'].'/', $mail_message);
+ $mail_message = str_replace('<base_url>', get_base_url().'/', $mail_message);
$mail_message = str_replace('<username>', $username, $mail_message);
$mail_message = str_replace('<password>', $password1, $mail_message);
- $mail_message = str_replace('<login_url>', $pun_config['o_base_url'].'/login.php', $mail_message);
+ $mail_message = str_replace('<login_url>', get_base_url().'/login.php', $mail_message);
$mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message);
pun_mail($email1, $mail_subject, $mail_message);

0 comments on commit c7be20e

Please sign in to comment.
Something went wrong with that request. Please try again.