Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/site/app/views/addons/share.thtml
blob: cddbb93e7d5e005f2d817fb6b6809edc1f1bcf07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php

        $url = FULL_BASE_URL . $html->url("/addon/{$addon_id}");

        $description = $html->truncateChars(250, $description);

        $title = $share_title;

        // Grab the URL template for the link sharing service and fill in the 
        // placeholders with the strings composed above.
        $link_data = compact('url', 'title', 'description');
        foreach ($link_data as $name => $value) {
            // replace &#42; with -
            $value = htmlspecialchars_decode($value);
            $value = html_entity_decode($value, ENT_QUOTES);
            
            $service_url = str_replace(
                '{'.strtoupper($name).'}', 
                rawurlencode($value), 
                $service_url
            );
        }

        // Finally, bounce the user off to the populated sharing URL.
        header('HTTP/1.1 302 Found');
        header('Location: ' . $service_url);
        exit;
?>