aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/functions.inc.php')
-rw-r--r--include/functions.inc.php34
1 files changed, 22 insertions, 12 deletions
diff --git a/include/functions.inc.php b/include/functions.inc.php
index 1675dbce8..83c9980de 100644
--- a/include/functions.inc.php
+++ b/include/functions.inc.php
@@ -493,7 +493,6 @@ function get_languages($target_charset = null)
}
closedir($dir);
@asort($languages);
- @reset($languages);
return $languages;
}
@@ -1373,17 +1372,6 @@ function load_language($filename, $dirname = '',
$source_file = $f;
break;
}
-
- if ($target_charset=='utf-8')
- { // we accept conversion from ISO-8859-1 to UTF-8
- $f = $dir.'.iso-8859-1/'.$filename;
- if (file_exists($f))
- {
- $source_charset = 'iso-8859-1';
- $source_file = $f;
- break;
- }
- }
}
if ( !empty($source_file) )
@@ -1483,4 +1471,26 @@ function secure_directory($dir)
@file_put_contents($file, 'Not allowed!');
}
}
+
+/**
+ * returns a "secret key" that is to be sent back when a user enters a comment
+ *
+ * @param int image_id
+ */
+function get_comment_post_key($image_id)
+{
+ global $conf;
+
+ $time = time();
+
+ return sprintf(
+ '%s:%s',
+ $time,
+ hash_hmac(
+ 'md5',
+ $time.':'.$image_id,
+ $conf['secret_key']
+ )
+ );
+}
?> \ No newline at end of file