Posts: 9
Threads: 1
Joined: Sep 2015
The function cmtx_commentics_url() in page.php seems to return NULL (blank). Hence the Absolute-path generated for "<img src=..." in processor.php using the function cmtx_commentics_url() is incorrect. The result is that the icons related to "Smilies and Editing" are not displayed. "Viewing Page Source" confirms incorrect path. I am using v2.5
example: <img src="images/smilies/smile.gif" title="Smile" Alt="Smile" ... ...
Is this noticed by others? Is there a patch?
Ramesh Rao
Posts: 2,894
Threads: 59
Joined: Jun 2010
Is the value of your 'Commentics URL' setting in 'Settings -> System' correct?
Have
you completed
the interview?
Posts: 9
Threads: 1
Joined: Sep 2015
Hi,
Thanks for the quick response. The Commentics URL is correctly set and it is
http://rkgenealogy.com/gen/comments/. Site URL is:
http://rkgenealogy.com.
An "echo $url" statement, such as below, inserted inside the code "function cmtx_commentics_url()" (page.php) inexplicably pre-pends and builds the 'absolute path' for the images. and the Form screen is complete with Smilies etc.
======================================================================================
echo "$url";
if (!parse_url(cmtx_setting('commentics_url'), PHP_URL_PATH) || !filter_var($url, FILTER_VALIDATE_URL)) {
$url = cmtx_url_encode(cmtx_setting('commentics_url'));
}
=====================================================================================
If on the other hand "echo $url" is placed immediately after three code-lines above, absolute path is NOT generated. This leads me to believe that the three lines of code re-sets variable $url to NULL or blank. And the string returned by cmtx_commenrics_url() is NULL or blank. I may be wrong.
Commentics supplied Example code can be run as: rkgenealogy.com/gen/cmtx.php.
Thanks in advance.
Ramesh Rao
Posts: 2,894
Threads: 59
Joined: Jun 2010
Can you let me know what the following outputs when added near the top of that function.
PHP Code:
<?php
var_dump('1: ' . cmtx_setting('commentics_url'));
var_dump('2: ' . parse_url(cmtx_setting('commentics_url'), PHP_URL_PATH));
if (isset($_SERVER['HTTPS'])) {
var_dump('3: ' . $_SERVER['HTTPS']);
} else {
var_dump('3: Not Set');
}
var_dump('4: ' . $_SERVER['HTTP_HOST']);
$url = 'http' . ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') ? 's' : '') . '://' . strtolower($_SERVER['HTTP_HOST']) . parse_url(cmtx_setting('commentics_url'), PHP_URL_PATH);
var_dump('5: ' . $url);
$url = cmtx_url_decode($url);
var_dump('6: ' . $url);
$url = cmtx_url_encode($url);
var_dump('7: ' . $url);
var_dump('8: ' . filter_var($url, FILTER_VALIDATE_URL));
var_dump('9: ' . cmtx_url_encode(cmtx_setting('commentics_url')));
Also does your server have the 'Filter' extension, which filter_var is a part of, enabled? If not then it could be causing a PHP error that's consequently affecting the output of the function. It would have said this during the system check of the installer or you can also find out using 'Reports -> PHP Info'.
Have
you completed
the interview?