Closed tetrahydra closed 6 years ago
Cant you just filter the ajax contents with jquery means?
we have to filter inappropriate word using another database and resize photos or disabled photos from being displayed. jquery will slow down the process as all of the words need to be sent along with the output.
Hmm ok, didnt got what you said intially. Why do you render a document incl. Doctype etc?
I tried like this before:
$doc_content->loadHTML($content_cms);
and this function doesnt work
$imgs = $doc_content->getElementsByTagName('img');
that loadHTML requires html rendering.
I still dont get what you are doing and why. Usually you would just return/render your $cms_content without this javascript loadHtml thing.
Could you provide more information, why you need this additional javascript?
the DOM and loadHTML are PHP code.
Get all non-permitted words from mysql database.
Filter the word from $cms_content.
Return the filtered content.
Get all IMG tags in $cms_content
Check the filename against mysql database
If not-permitted for display, remove the tag.
Return filtered content.
I have it solved.
$content_cms = preg_replace('~<(?:!DOCTYPE|/?(?:html|head|body))[^>]*>\s*~i', '', $content_cms);
I need to change/filter some contents before that it is being displayed, so I use this DOM method.
On every page that uses this method PJAX will hard (force) load the page. When I remove this process, PJAX works fine.
Is there any work around for this issue?