mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
- wrap json_encode in Util::toJson to always encode with the same flags
- implemented secondary tooltips with spawnPoints - merged Mapper.js back into global.js * fixed wrong id for Nexus Instance * the ToC Dungeon no longer has a second layer - fixed displaying waypoints as spawns - images in pageText are now PNG instead of JPG to accomodate for transparency
This commit is contained in:
@@ -927,8 +927,12 @@ class Util
|
||||
'<BR></BR>' => '<br />'
|
||||
);
|
||||
|
||||
// html may contain 'Pictures'
|
||||
$text = preg_replace('/"Interface\\\Pictures\\\([\w_\-]+)"/i', '"images/wow/interface/Pictures/\1.jpg"', strtr($text, $pairs));
|
||||
// html may contain 'Pictures' and FlavorImages and "stuff"
|
||||
$text = preg_replace_callback(
|
||||
'/src="([^"]+)"/i',
|
||||
function ($m) { return 'src="'.STATIC_URL.'/images/wow/'.strtr($m[1], ['\\' => '/']).'.png"'; },
|
||||
strtr($text, $pairs)
|
||||
);
|
||||
}
|
||||
else
|
||||
$text = strtr($text, ["\n" => '<br />', "\r" => '']);
|
||||
@@ -1724,6 +1728,19 @@ class Util
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
}
|
||||
|
||||
public static function toJSON($data)
|
||||
{
|
||||
$flags = JSON_NUMERIC_CHECK | JSON_UNESCAPED_UNICODE;
|
||||
|
||||
if (CFG_DEBUG)
|
||||
$flags |= JSON_PRETTY_PRINT;
|
||||
|
||||
// just a thought: .. about prefixing variables with $ to mark them as function code and retroactively stripping escapes from them
|
||||
// like it's done already in with listviews for example
|
||||
|
||||
return json_encode($data, $flags);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user