⌈⌋ branch:  freshcode


Check-in [de80c25858]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Check for UTF-8 encoding mismatches before piping row to feed. Also: add `summary` field.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: de80c25858cc138319686eed50d2e3d9eec437de
User & Date: mario 2017-06-12 23:11:09
Context
2018-01-21
10:26
Remove linux.com software check-in: 4d70d4206f user: mario tags: trunk
2017-06-12
23:11
Check for UTF-8 encoding mismatches before piping row to feed. Also: add `summary` field. check-in: de80c25858 user: mario tags: trunk
2017-01-31
18:43
Additional howto/comments on login page regarding `lock` field requiring proper password hash or OpenID handle. check-in: f21257ed67 user: mario tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to page_feed.php.

42
43
44
45
46
47
48

49
50
51
52
53
54
55
 */

#-- general project description
function feed_project($row) {
    return array(
        "name" => $row["name"],
        "title" => $row["title"],

        "description" => $row["description"],
        "homepage" => $row["homepage"],
        "license" => $row["license"],
        "tags" => $row["tags"],
        "image" => $row["image"],
        "submitter" => $row["submitter"],
        "urls" => p_key_value($row["urls"], CASE_LOWER),







>







42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
 */

#-- general project description
function feed_project($row) {
    return array(
        "name" => $row["name"],
        "title" => $row["title"],
        "summary" => $row["summary"],
        "description" => $row["description"],
        "homepage" => $row["homepage"],
        "license" => $row["license"],
        "tags" => $row["tags"],
        "image" => $row["image"],
        "submitter" => $row["submitter"],
        "urls" => p_key_value($row["urls"], CASE_LOWER),
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118

119

120


121
122
123
124
125
126
127
                FROM release
               WHERE NOT deleted
                 AND NOT hidden
            GROUP BY name, t_published
            ORDER BY t_published DESC, t_changed DESC
               LIMIT ?
              OFFSET ?",
            $_GET->int->default…100->range…5…15000["num"],
            $_GET->int->default…0["offset"]
        );
#        $i = 0;
#        error_reporting(E_ALL);
#        set_error_handler("var_dump");
        foreach ($r as $row) {
#        print " " . ($i++);

            $feed["releases"][] = feed_project($row) + feed_release($row) + feed_xfer($row);

        }


    }

    
    #-- per project
    else {
        $r = db("SELECT * FROM release_versions WHERE name=? LIMIT 10", $name);
        while ( $row = $r->fetch() ) {







|


|



|
>
|
>

>
>







105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
                FROM release
               WHERE NOT deleted
                 AND NOT hidden
            GROUP BY name, t_published
            ORDER BY t_published DESC, t_changed DESC
               LIMIT ?
              OFFSET ?",
            $_GET->int->default…100->range…1…15000["num"],
            $_GET->int->default…0["offset"]
        );
        $i = $f = 0;
#        error_reporting(E_ALL);
#        set_error_handler("var_dump");
        foreach ($r as $row) {
            $i++;
            if (json_encode($row)) {
                 $feed["releases"][] = feed_project($row) + feed_release($row) + feed_xfer($row);
            } else { $f++; }
        }
        header("X-Count: $i");
        header("X-Invalid-Encoding: $f");
    }

    
    #-- per project
    else {
        $r = db("SELECT * FROM release_versions WHERE name=? LIMIT 10", $name);
        while ( $row = $r->fetch() ) {