Quantcast
Channel: Joomla! Forum - community, help and support
Viewing all articles
Browse latest Browse all 1912

Joomla! 5.x Coding • Re: Using the Webservices API to read an article

$
0
0
Hey David,

You cannot search for HTML code parts since the search string is cleaned with the STRING filter (HTML tags are removed).

If you really need to search for HTML code, you must do a small core hack to set the filter to RAW instead of STRING. But remember that the change is not update-safe, and you must reapply it after the next core update!

Open: api/components/com_content/src/Controller/ArticlesController.php

Search:

Code:

$this->modelState->set('filter.search', $filter->clean($apiFilterInfo['search'], 'STRING'));
Change to:

Code:

$this->modelState->set('filter.search', $filter->clean($apiFilterInfo['search'], 'RAW'));
Now you can trigger your API call like:

Code:

DOMAIN/api/index.php/v1/content/articles?filter[search]=content:<ul id="newsletters_list">
Have success!

Statistics: Posted by Kubik-Rubik — Wed Apr 17, 2024 9:34 pm



Viewing all articles
Browse latest Browse all 1912

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>