Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Photon-Plugin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jan Grewe
Photon-Plugin
Commits
9b598b40
Commit
9b598b40
authored
11 years ago
by
Kevin Langley Jr
Browse files
Options
Downloads
Patches
Plain Diff
fixing rewrite of urls without path part
parent
92dae5be
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+10
-2
10 additions, 2 deletions
README.md
cdn-rewrite.php
+7
-2
7 additions, 2 deletions
cdn-rewrite.php
readme.txt
+1
-1
1 addition, 1 deletion
readme.txt
with
18 additions
and
5 deletions
README.md
+
10
−
2
View file @
9b598b40
...
@@ -4,7 +4,7 @@ Contributors: voceplatforms, chrisscott, prettyboymp
...
@@ -4,7 +4,7 @@ Contributors: voceplatforms, chrisscott, prettyboymp
Tags: cdn, rewrite
Tags: cdn, rewrite
Requires at least: 3.3
Requires at least: 3.3
Tested up to: 3.8
Tested up to: 3.8
Stable tag: 0.1.
0
Stable tag: 0.1.
1
License: GPLv2 or later
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
License URI: http://www.gnu.org/licenses/gpl-2.0.html
...
@@ -19,3 +19,11 @@ If using [Composer](http://getcomposer.org) for dependency management, you can a
...
@@ -19,3 +19,11 @@ If using [Composer](http://getcomposer.org) for dependency management, you can a
### As standard plugin:
### As standard plugin:
> See [Installing Plugins](http://codex.wordpress.org/Managing_Plugins#Installing_Plugins).
> See [Installing Plugins](http://codex.wordpress.org/Managing_Plugins#Installing_Plugins).
## Changelog
**
0.1.1
**
*Fixing issue with URLs without a path part.*
**
0.1.0
**
*Initial version.*
\ No newline at end of file
This diff is collapsed.
Click to expand it.
cdn-rewrite.php
+
7
−
2
View file @
9b598b40
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
Plugin Name: CDN Rewrite
Plugin Name: CDN Rewrite
Plugin URI: http://voceconnect.com/
Plugin URI: http://voceconnect.com/
Description: Rewrites asset URLs to CDN
Description: Rewrites asset URLs to CDN
Version: 0.1
Version: 0.1
.1
Author: Chris Scott, Michael Pretty
Author: Chris Scott, Michael Pretty
Author URI: http://voceconnect.com/
Author URI: http://voceconnect.com/
*/
*/
...
@@ -206,6 +206,11 @@ if( !class_exists( 'CDN_Rewrite' ) ){
...
@@ -206,6 +206,11 @@ if( !class_exists( 'CDN_Rewrite' ) ){
private
function
get_version
(
$url
)
{
private
function
get_version
(
$url
)
{
if
(
0
===
strpos
(
$url
,
$this
->
root_url
))
{
if
(
0
===
strpos
(
$url
,
$this
->
root_url
))
{
$parts
=
parse_url
(
$url
);
$parts
=
parse_url
(
$url
);
foreach
(
array
(
'scheme'
,
'host'
,
'path'
)
as
$part
){
if
(
!
isset
(
$parts
[
$part
]
)
)
return
false
;
}
$file_path
=
str_replace
(
site_url
(
'/'
),
ABSPATH
,
$parts
[
'scheme'
]
.
'://'
.
$parts
[
'host'
]
.
$parts
[
'path'
]
);
$file_path
=
str_replace
(
site_url
(
'/'
),
ABSPATH
,
$parts
[
'scheme'
]
.
'://'
.
$parts
[
'host'
]
.
$parts
[
'path'
]
);
if
(
!
(
$version
=
@
filemtime
(
$file_path
))
)
{
if
(
!
(
$version
=
@
filemtime
(
$file_path
))
)
{
$version
=
$this
->
default_version
;
$version
=
$this
->
default_version
;
...
...
This diff is collapsed.
Click to expand it.
readme.txt
+
1
−
1
View file @
9b598b40
...
@@ -3,7 +3,7 @@ Contributors: voceplatforms, chrisscott, prettyboymp
...
@@ -3,7 +3,7 @@ Contributors: voceplatforms, chrisscott, prettyboymp
Tags: cdn, rewrite
Tags: cdn, rewrite
Requires at least: 3.3
Requires at least: 3.3
Tested up to: 3.8
Tested up to: 3.8
Stable tag: 0.1.
0
Stable tag: 0.1.
1
License: GPLv2 or later
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
License URI: http://www.gnu.org/licenses/gpl-2.0.html
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment