aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-08-29 16:46:22 -0700
committerfriendica <info@friendica.com>2013-08-29 16:46:22 -0700
commit70c0beb857d879b8c2c74ac0922f82b37717c989 (patch)
tree032175eb350fc3255f408b3734e85b1fdd541174
parentb4bd518e4032661cdfba4e17acdb94e19b23fdd2 (diff)
downloadvolse-hubzilla-70c0beb857d879b8c2c74ac0922f82b37717c989.tar.gz
volse-hubzilla-70c0beb857d879b8c2c74ac0922f82b37717c989.tar.bz2
volse-hubzilla-70c0beb857d879b8c2c74ac0922f82b37717c989.zip
block attempts to set the baseurl to an ip address if it was previously a dns name
-rwxr-xr-xboot.php16
-rw-r--r--mod/page.php17
-rw-r--r--mod/settings.php2
-rw-r--r--version.inc2
4 files changed, 25 insertions, 12 deletions
diff --git a/boot.php b/boot.php
index ed378a45b..a5ff7ea0b 100755
--- a/boot.php
+++ b/boot.php
@@ -1164,9 +1164,21 @@ function check_config(&$a) {
set_config('system','urlverify',bin2hex(z_root()));
if(($saved) && ($saved != bin2hex(z_root()))) {
// our URL changed. Do something.
+
$oldurl = hex2bin($saved);
- fix_system_urls($oldurl,z_root());
- set_config('system','urlverify',bin2hex(z_root()));
+
+ $oldhost = substr($oldurl,strpos($oldurl,'//')+2);
+ $host = substr(z_root(),strpos(z_root(),'//')+2);
+
+ $is_ip_addr = ((preg_match("/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/",$host)) ? true : false);
+ $was_ip_addr = ((preg_match("/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/",$oldhost)) ? true : false);
+ // only change the url to an ip address if it was already an ip and not a dns name
+ if((! $is_ip_addr) || ($is_ip_addr && $was_ip_addr)) {
+ fix_system_urls($oldurl,z_root());
+ set_config('system','urlverify',bin2hex(z_root()));
+ }
+ else
+ logger('Attempt to change baseurl from a DNS name to an IP address was refused.');
}
// This will actually set the url to the one stored in .htconfig, and ignore what
diff --git a/mod/page.php b/mod/page.php
index 4b2b95b6a..110d9699c 100644
--- a/mod/page.php
+++ b/mod/page.php
@@ -6,16 +6,17 @@ require_once('include/page_widgets.php');
function page_init(&$a) {
// We need this to make sure the channel theme is always loaded.
- $which = argv(1);
- $profile = 0;
- $channel = $a->get_channel();
- if((local_user()) && (argc() > 2) && (argv(2) === 'view')) {
- $which = $channel['channel_address'];
- $profile = argv(1);
- }
+ $which = argv(1);
+ $profile = 0;
+ $channel = $a->get_channel();
- profile_load($a,$which,$profile);
+ if((local_user()) && (argc() > 2) && (argv(2) === 'view')) {
+ $which = $channel['channel_address'];
+ $profile = argv(1);
+ }
+
+ profile_load($a,$which,$profile);
}
diff --git a/mod/settings.php b/mod/settings.php
index 2a3a64581..6b21066b1 100644
--- a/mod/settings.php
+++ b/mod/settings.php
@@ -997,7 +997,7 @@ function settings_content(&$a) {
$stpl = get_markup_template('settings.tpl');
- $celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false);
+ $celeb = false;
$expire_arr = array(
'days' => array('expire', t("Automatically expire posts after this many days:"), $expire, t('If empty, posts will not expire. Expired posts will be deleted')),
diff --git a/version.inc b/version.inc
index 6733945d4..06ed318a0 100644
--- a/version.inc
+++ b/version.inc
@@ -1 +1 @@
-2013-08-28.419
+2013-08-29.420