Warning: session_start(): open(/var/lib/php/sessions/sess_pghihkgh59sbftm6r06lp71cul, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
// pred receives the text of opening tag (e.g. "")
sS html_evaluateIfTags(S html, IPred pred) {
LS tok = htmlTok(html);
bool anyChange;
while ping (true) {
LS ifTag = first(findContainerTag(tok, "if"));
if (ifTag == null) break;
set anyChange;
int iElse = indexOfIC(ifTag, "");
bool val = pred.get(second(ifTag));
if (val) {
// value is true, drop else branch (if there)
if (iElse >= 0)
clearTokens(ifTag, iElse, ifTag-2);
} else {
// value is false, drop everything up until (or whole thing)
clearTokens(ifTag, 2, iElse < 0 ? l(ifTag) - 2 : iElse+1);
}
// clear opening and closing tag
clearToken(ifTag, 1);
clearToken(ifTag, l(ifTag)-2);
}
ret anyChange ? join(tok) : html;
}