summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers
diff options
context:
space:
mode:
authorAndy Staudacher <andy.st@gmail.com>2009-08-30 15:21:02 -0700
committerAndy Staudacher <andy.st@gmail.com>2009-08-30 15:21:02 -0700
commitbeb711d6a0fedac0d4ca3b9bae162a6ce9d6cdeb (patch)
treebfb916d5c36c686b4ebcdab8e8c820b7f5302ace /modules/gallery/helpers
parentb5813f92c7a73e11d47d1943c217fdf6b7e41de9 (diff)
Rename clean_js to js_string and have it return a complete JS string (with delimiters) instead of just the string contents.
Benefits: Using json_encode(), which is very robust. And as a user, it's clearer how to use this API compared to what it was before.
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r--modules/gallery/helpers/MY_html.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/gallery/helpers/MY_html.php b/modules/gallery/helpers/MY_html.php
index 75114898..4522d01c 100644
--- a/modules/gallery/helpers/MY_html.php
+++ b/modules/gallery/helpers/MY_html.php
@@ -65,11 +65,11 @@ class html extends html_Core {
*
* Example:<pre>
* <script type="text/javascript>"
- * var some_js_var = "<?= html::clean_js($php_var) ?>";
+ * var some_js_string = <?= html::js_string($php_string) ?>;
* </script>
* </pre>
*/
- static function clean_js($string) {
+ static function js_string($string) {
return SafeString::of($string)->for_js();
}