Jump to content

Help null out a function


mrjkb

Recommended Posts

I am running an oscommerce site and loaded an new contribution, but cannot get any contribution support to make it work. I am getting an error of:

 

Fatal error: Call to undefined function: clean_html_comments() in /var/www/html/includes/article_header_tags.php on line 134

when I click on New Articles

 

and

 

Fatal error: Call to undefined function: clean_html_comments() in /var/www/html/articles.php on line 350

when I click on All Articles

 

and

 

Fatal error: Call to undefined function: clean_html_comments() in /var/www/html/includes/article_header_tags.php on line 104

 

when I click on an article I posted. All worked well until I posted an article.

 

This is line 350 from articles.php in the second error

 

<td class="main" style="padding-left:15px"><?php echo clean_html_comments(substr($articles_all['articles_head_desc_tag'],0, MAX_ARTICLE_ABSTRACT_LENGTH)) . ((strlen($articles_all['articles_head_desc_tag']) >= MAX_ARTICLE_ABSTRACT_LENGTH) ? '...' : ''); ?></td>

 

 

I have been working down the path of adding this to application_top.php

 

// articles fix

if (function_exists('clean_html_comments')) {

????(???);

}

 

but am not sure what to put into the ???? area to get this to null out. Any Help or other suggestions?

Link to comment
https://forums.phpfreaks.com/topic/2437-help-null-out-a-function/
Share on other sites

clean_html_comments() is a user defined function.

First question is: do you have in that file included another file where clean_html_comments() is defined? have you searched to see where is defined?

 

 

function clean_html_comments() could cotain some code with strip_tags(), etc...

 

 

googleing showed this:

you have to add this line in application.top

require(DIR_WS_FUNCTIONS . 'clean_html_comments.php');

 

Link to comment
https://forums.phpfreaks.com/topic/2437-help-null-out-a-function/#findComment-8069
Share on other sites

clean_html_comments() is a user defined function.

First question is: do you have in that file included another file where clean_html_comments() is defined? have you searched to see where is defined?

function clean_html_comments() could cotain some code with strip_tags(), etc...

googleing showed this:

you have to add this line in application.top

require(DIR_WS_FUNCTIONS . 'clean_html_comments.php');

263075[/snapback]

 

I did try to add the require(DIR_WS_FUNCTIONS . 'clean_html_comments.php'); to application top to no avail.

 

Here is my clean_html_comment file:

 

// Clean out HTML comments code

function clean_html_comments($clean_html) {

global $its_cleaned;

 

if ( strpos($clean_html,'<!--//*')>1 ) {

$the_end1= strpos($clean_html,'<!--//*')-1;

$the_start2= strpos($clean_html,'*//-->')+7;

 

$its_cleaned= substr($clean_html,0,$the_end1);

$its_cleaned.= substr($clean_html,$the_start2);

} else {

$its_cleaned= $clean_html;

}

return $its_cleaned;

}

 

?>

 

do you mean is clean_html in article_header_tags.php ?

Link to comment
https://forums.phpfreaks.com/topic/2437-help-null-out-a-function/#findComment-8070
Share on other sites

Here is the code in articles.php that calls for clean_html_comments

 

<tr>

<td class="main" style="padding-left:15px"><?php echo clean_html_comments(substr($articles_all['articles_head_desc_tag'],0, MAX_ARTICLE_ABSTRACT_LENGTH)) . ((strlen($articles_all['articles_head_desc_tag']) >= MAX_ARTICLE_ABSTRACT_LENGTH) ? '...' : ''); ?></td>

</tr>

 

Link to comment
https://forums.phpfreaks.com/topic/2437-help-null-out-a-function/#findComment-8071
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.