mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-06-16 23:19:53 -04:00
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.
This commit is contained in:
@@ -40,9 +40,9 @@ class Html_Helper_Test extends Unit_Test_Case {
|
||||
$safe_string_2);
|
||||
}
|
||||
|
||||
public function clean_js_test() {
|
||||
$string = html::clean_js("hello's <p >world</p>");
|
||||
$this->assert_equal("hello\\'s <p >world<\\/p>",
|
||||
public function js_string_test() {
|
||||
$string = html::js_string("hello's <p >world</p>");
|
||||
$this->assert_equal('"hello\'s <p >world<\\/p>"',
|
||||
$string);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user