diff options
author | David Farning <dfarning@gmail.com> | 2009-02-21 00:15:16 (GMT) |
---|---|---|
committer | David Farning <dfarning@gmail.com> | 2009-02-21 00:24:12 (GMT) |
commit | bc6f60be961e3a3febc49ad24ff8f391860b266b (patch) | |
tree | a8d0dd3bda4dbe01c42f725ef5f477760bbcb061 | |
parent | 3434f32b9580fe37a1839bf2ddb91bd056ad6417 (diff) |
Replace hardcoded secure a.m.o with SSITE_URL This patch replaces the hardcoded string https://addons.mozilla.org with a new constant defined in config.php SSITE_URL in all .thtml files
-rw-r--r-- | site/app/config/config.php.default | 10 | ||||
-rw-r--r-- | site/app/config/constants.php | 7 | ||||
-rw-r--r-- | site/app/views/api/api_addon.thtml | 2 | ||||
-rw-r--r-- | site/app/views/api/collections_feed.thtml | 2 | ||||
-rw-r--r-- | site/app/views/facebook/view.thtml | 2 | ||||
-rw-r--r-- | site/app/views/layouts/facebook.thtml | 2 |
6 files changed, 21 insertions, 4 deletions
diff --git a/site/app/config/config.php.default b/site/app/config/config.php.default index c9e83e7..52b1a24 100644 --- a/site/app/config/config.php.default +++ b/site/app/config/config.php.default @@ -60,6 +60,16 @@ // define('SITE_URL', ''); /** + * Secure Site URL + * Example: https://addons.mozilla.org + * Example: https://khan-vm.mozilla.org (dev) + * Example of getting a full controller url: + * echo SITE_URL.$html->url('/users/register'); + * Will default to https://addons.mozilla.org unless defined below + */ +// define('SITE_URL', ''); + +/** * Services URL. * Example: http://addons.mozilla.org/services * Example: http://khan-vm.mozilla.org/amo/services (dev) diff --git a/site/app/config/constants.php b/site/app/config/constants.php index c84d630..8db28d5 100644 --- a/site/app/config/constants.php +++ b/site/app/config/constants.php @@ -46,6 +46,13 @@ if (!defined('SITE_URL')) define('SITE_URL', 'http://addons.mozilla.org'); + +/** + * Secure Site URL default + */ +if (!defined('SSITE_URL')) + define('SSITE_URL', 'https://addons.mozilla.org'); + /** * Site State default */ diff --git a/site/app/views/api/api_addon.thtml b/site/app/views/api/api_addon.thtml index ddef7cd..ab736fb 100644 --- a/site/app/views/api/api_addon.thtml +++ b/site/app/views/api/api_addon.thtml @@ -39,7 +39,7 @@ $addonIconPath = ($addon['Addon']['addontype_id'] == ADDON_THEME ? $html->urlImage(DEFAULT_THEME_ICON) : $html->urlImage(DEFAULT_ADDON_ICON)); } - $amo = 'https://addons.mozilla.org'; + $amo = SSITE_URL; ?> <addon> <?php diff --git a/site/app/views/api/collections_feed.thtml b/site/app/views/api/collections_feed.thtml index 3e856ff..9c645e8 100644 --- a/site/app/views/api/collections_feed.thtml +++ b/site/app/views/api/collections_feed.thtml @@ -54,7 +54,7 @@ if (isset($error)) { ?> $addonIconPath = ($addon['addontype_id'] == ADDON_THEME ? $html->urlImage(DEFAULT_THEME_ICON) : $html->urlImage(DEFAULT_ADDON_ICON)); } - $amo = 'https://addons.mozilla.org'; + $amo = 'SSITE_URL; ?> <addon> <meta> diff --git a/site/app/views/facebook/view.thtml b/site/app/views/facebook/view.thtml index 2c732eb..ddc9442 100644 --- a/site/app/views/facebook/view.thtml +++ b/site/app/views/facebook/view.thtml @@ -216,7 +216,7 @@ <div class="profileActions clearfix"> <?=(!empty($addon['Translation']['privacypolicy']['string']) ? '<a href="#" clicktotoggle="privacypolicy">Privacy Policy</a>' : '')?> <?=(!empty($addon['Translation']['homepage']['string']) ? '<a href="'.$addon['Translation']['homepage']['string'].'" target="_blank">Add-on Homepage</a>' : '')?> - <a href="https://addons.mozilla.org/addon/<?=$addon['Addon']['id']?>">Mozilla Add-ons Listing</a> + <a href="<?=SSITE_URL?>/addon/<?=$addon['Addon']['id']?>">Mozilla Add-ons Listing</a> </div> <div class="header"><h2>Recommended By</h2></div> diff --git a/site/app/views/layouts/facebook.thtml b/site/app/views/layouts/facebook.thtml index 244d981..f7a1a4c 100644 --- a/site/app/views/layouts/facebook.thtml +++ b/site/app/views/layouts/facebook.thtml @@ -91,7 +91,7 @@ if (empty($page)) { <div class="page-footer"> Mozilla is providing links to these applications as a courtesy, and makes no representations regarding the applications or any information related there to. - <span title="<?=php_uname('n')?>">Use</span> of this service is subject to the Mozilla <a href="https://addons.mozilla.org/en-US/firefox/pages/privacy">Privacy Policy</a> and <a href="http://www.mozilla.com/en-US/about/legal.html">Legal Notices</a>. + <span title="<?=php_uname('n')?>">Use</span> of this service is subject to the Mozilla <a href="<?=SSITE_URL?>/en-US/firefox/pages/privacy">Privacy Policy</a> and <a href="http://www.mozilla.com/en-US/about/legal.html">Legal Notices</a>. </div> </div> |