#2850 - Inconsistency in templates_internalise_screen.php

This is a spacer post for a website comment topic. The content this topic relates to: #2850 - Inconsistency in templates_internalise_screen.php
That's not true. The hook only runs in AJAX, after that line in a new request. And the md5 in that is used to compare with the md5 from that line. md5'ing is used so that secure information isn't transmitted in the clear.

Shouldn't the change_detection hooks then have md5(serialize(...)) removed then? Having md5(serialize(...)) in both the hooks and in templates_internalise_screen.php is causing a condition in which REFRESH_IF_CHANGED was already md5(serialize(...))d by the hook, and then done again in the PHP file, resulting in mismatches. It results in mismatches because the backend PHP has the hash that was only md5(serialize(...))d once, but AJAX has the one that was md5(serialize(...))d twice.

I've confirmed this by removing it from templates_internalise_screen.php but leaving it in the hooks. The value is still transferred to AJAX template in MD% format, but it actually matches when there's no change this time opposed to being different.

You must be getting confused somewhere, because I tested this as working before, and the code definitely isn't working as you think it is.

1) md5+serialize done
2) this is passed to template
3) this is passed via AJAX to hook
4) md5+serialize done within hook
6) this is compared to what was passed
7) if they are the same, AJAX is told there was no change

i.e. the hook is only for AJAX, and does not run at all prior to AJAX. The md5 is intentionally done twice because that is the comparison. It is not done twice in sequence to the same data.
0 guests and 0 members have recently viewed this.