Commit bfe5a992 authored by Ad Schellevis's avatar Ad Schellevis

(legacy) whitespace rc.update_alias_url_data

parent a00e5194
#!/usr/local/bin/php #!/usr/local/bin/php
<?php <?php
/* /*
Copyright (C) 2010 Scott Ullrich <sullrich@gmail.com> Copyright (C) 2010 Scott Ullrich <sullrich@gmail.com>
All rights reserved. All rights reserved.
...@@ -36,13 +35,13 @@ function update_alias_url_data() ...@@ -36,13 +35,13 @@ function update_alias_url_data()
global $config; global $config;
$updated = false; $updated = false;
/* item is a url type */ /* item is a url type */
$lockkey = lock('aliasurl'); $lockkey = lock('aliasurl');
if (isset($config['aliases']['alias']) && is_array($config['aliases']['alias'])) { if (isset($config['aliases']['alias']) && is_array($config['aliases']['alias'])) {
foreach ($config['aliases']['alias'] as $x => $alias) { foreach ($config['aliases']['alias'] as $x => $alias) {
if (empty($alias['aliasurl'])) if (empty($alias['aliasurl'])) {
continue; continue;
}
$address = ""; $address = "";
$isfirst = 0; $isfirst = 0;
...@@ -56,12 +55,14 @@ function update_alias_url_data() ...@@ -56,12 +55,14 @@ function update_alias_url_data()
/* if the item is tar gzipped then extract */ /* if the item is tar gzipped then extract */
if (stripos($alias_url, '.tgz')) { if (stripos($alias_url, '.tgz')) {
if (!process_alias_tgz($temp_filename)) if (!process_alias_tgz($temp_filename)) {
continue; continue;
} else if (stripos($alias_url, '.zip')) { }
if (!process_alias_unzip($temp_filename)) } elseif (stripos($alias_url, '.zip')) {
if (!process_alias_unzip($temp_filename)) {
continue; continue;
} }
}
if (file_exists("{$temp_filename}/aliases")) { if (file_exists("{$temp_filename}/aliases")) {
$fd = @fopen("{$temp_filename}/aliases", 'r'); $fd = @fopen("{$temp_filename}/aliases", 'r');
if (!$fd) { if (!$fd) {
...@@ -71,13 +72,16 @@ function update_alias_url_data() ...@@ -71,13 +72,16 @@ function update_alias_url_data()
/* NOTE: fgetss() is not a typo RTFM before being smart */ /* NOTE: fgetss() is not a typo RTFM before being smart */
while (($fc = fgetss($fd)) !== FALSE) { while (($fc = fgetss($fd)) !== FALSE) {
$tmp = trim($fc, " \t\n\r"); $tmp = trim($fc, " \t\n\r");
if (empty($tmp)) if (empty($tmp)) {
continue; continue;
}
$tmp_str = strstr($tmp, '#', true); $tmp_str = strstr($tmp, '#', true);
if (!empty($tmp_str)) if (!empty($tmp_str)) {
$tmp = $tmp_str; $tmp = $tmp_str;
if ($isfirst == 1) }
if ($isfirst == 1) {
$address .= ' '; $address .= ' ';
}
$address .= $tmp; $address .= $tmp;
$isfirst = 1; $isfirst = 1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment