Skip to content
This repository has been archived by the owner on Jul 21, 2021. It is now read-only.

Commit

Permalink
fixed to preserve the case of blog url subdirs
Browse files Browse the repository at this point in the history
  • Loading branch information
lbourne43 committed Apr 15, 2014
2 parents dcdeac6 + 52740be commit 5b82cbe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions joomla_1.5/com_wordbridge/site/helpers/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,11 @@ function getBlogInfo( $blogname = null, $useStored = false )
}
else
{
#################################
if (preg_match("/^https?:\/\/.+/", $fqdn)) {
$url = sprintf( '%s/?feed=wordbridge', $fqdn );
} else {
$url = sprintf( 'http://%s/?feed=wordbridge', $fqdn );
}
#################################
$curl = curl_init();
curl_setopt( $curl, CURLOPT_URL, $url );

Expand Down Expand Up @@ -193,7 +191,6 @@ function storeBlog( $id, $uuid, $name, $description, $last_post )

function nameToSlug( $name )
{
#$name = strtolower( trim ( $name ) );
$name = trim ( $name ) ;
$name = preg_replace( '/[\.\s]/', '-', $name );
$name = preg_replace( '/[^\-a-z0-9]/', '', $name );
Expand Down Expand Up @@ -435,6 +432,7 @@ function curl_redir_exec( $ch, $curl_loops = 0 )
function fqdnBlogName( $name )
{
$name = trim( $name ) ;

if ( strpos( $name, '.' ) == false )
{
return sprintf( '%s.wordpress.com', strtolower( $name ) );
Expand All @@ -449,6 +447,7 @@ function fqdnBlogName( $name )
{
$name = strtolower( $name );
}

return $name;
}

Expand Down
2 changes: 1 addition & 1 deletion joomla_1.5/com_wordbridge/site/models/entries.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ function _loadEntriesFromWeb( $page = 1 )
{
return false;
}

$url = WordbridgeHelper::fqdnBlogName( $blogname );
if (!preg_match("/^https?:\/\/.+/", $url)) {
$url = sprintf( 'http://%s', $url );
}

$url = sprintf( '%s/?feed=rss2&paged=%d',
$url, (int) $page );

Expand Down

0 comments on commit 5b82cbe

Please sign in to comment.