diff options
Diffstat (limited to 'engine/lib/metastrings.php')
-rw-r--r-- | engine/lib/metastrings.php | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/engine/lib/metastrings.php b/engine/lib/metastrings.php index 94529e16f..31981efab 100644 --- a/engine/lib/metastrings.php +++ b/engine/lib/metastrings.php @@ -68,18 +68,18 @@ $METASTRINGS_DEADNAME_CACHE[$string] = $string; return false; - }
-
- /**
- * When given an ID, returns the corresponding metastring
- *
- * @param int $id Metastring ID
- * @return string Metastring
- */
- function get_metastring($id) {
-
- global $CONFIG, $METASTRINGS_CACHE;
-
+ } + + /** + * When given an ID, returns the corresponding metastring + * + * @param int $id Metastring ID + * @return string Metastring + */ + function get_metastring($id) { + + global $CONFIG, $METASTRINGS_CACHE; + $id = (int) $id; if (isset($METASTRINGS_CACHE[$id])) { @@ -88,20 +88,20 @@ error_log("** Returning string for id:$id from cache."); return $METASTRINGS_CACHE[$id]; - }
-
- $row = get_data_row("SELECT * from {$CONFIG->dbprefix}metastrings where id='$id' limit 1");
+ } + + $row = get_data_row("SELECT * from {$CONFIG->dbprefix}metastrings where id='$id' limit 1"); if ($row) { $METASTRINGS_CACHE[$id] = $row->string; // Cache it if ($CONFIG->debug) error_log("** Cacheing string '{$row->string}'"); -
+ return $row->string; - }
-
- return false;
-
+ } + + return false; + } /** |