mambax7 /
adslight
| 1 | <?php |
||
| 2 | /* |
||
| 3 | ------------------------------------------------------------------------- |
||
| 4 | ADSLIGHT 2 : Module for Xoops |
||
| 5 | |||
| 6 | Redesigned and ameliorate By Luc Bizet user at www.frxoops.org |
||
| 7 | Started with the Classifieds module and made MANY changes |
||
| 8 | Website : http://www.luc-bizet.fr |
||
| 9 | Contact : [email protected] |
||
| 10 | ------------------------------------------------------------------------- |
||
| 11 | Original credits below Version History |
||
| 12 | ########################################################################## |
||
| 13 | # Classified Module for Xoops # |
||
| 14 | # By John Mordo user jlm69 at www.xoops.org and www.jlmzone.com # |
||
| 15 | # Started with the MyAds module and made MANY changes # |
||
| 16 | ########################################################################## |
||
| 17 | Original Author: Pascal Le Boustouller |
||
| 18 | Author Website : [email protected] |
||
| 19 | Licence Type : GPL |
||
| 20 | ------------------------------------------------------------------------- |
||
| 21 | */ |
||
| 22 | |||
| 23 | ///////////////////////////////////// |
||
| 24 | // AdsLight UrlRewrite By Nikita // |
||
| 25 | // http://www.aideordi.com // |
||
| 26 | ///////////////////////////////////// |
||
| 27 | |||
| 28 | use Xmf\Request; |
||
|
0 ignored issues
–
show
|
|||
| 29 | |||
| 30 | $seoOp = Request::getString('seoOp', '', 'GET'); |
||
| 31 | $seoArg = Request::getString('seoArg', '', 'GET'); |
||
| 32 | $seoOther = Request::getString('seoOther', '', 'GET'); |
||
| 33 | |||
| 34 | if (!empty($seoOther)) { |
||
| 35 | $seoOther = explode('/', $seoOther); |
||
| 36 | } |
||
| 37 | |||
| 38 | $seoMap = [ |
||
| 39 | 'c' => 'viewcats.php', |
||
| 40 | 'p' => 'viewads.php' |
||
| 41 | // 'addlisting' => 'addlisting.php' |
||
|
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
50% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them. Loading history...
|
|||
| 42 | |||
| 43 | ]; |
||
| 44 | |||
| 45 | if (!empty($seoOp) && !empty($seoMap[$seoOp])) { |
||
| 46 | // module specific dispatching logic, other module must implement as |
||
| 47 | // per their requirements. |
||
| 48 | $newUrl = '/modules/adslight/' . $seoMap[$seoOp]; |
||
| 49 | |||
| 50 | // if your site is in a folder. ex: www.welcome.com/xoops_site/ |
||
| 51 | // Replace the line above, for it |
||
| 52 | // $newUrl = '/yourfile/modules/adslight/' . $seoMap[$seoOp]; |
||
|
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
50% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them. Loading history...
|
|||
| 53 | |||
| 54 | $_ENV['PHP_SELF'] = $newUrl; |
||
| 55 | $_SERVER['SCRIPT_NAME'] = $newUrl; |
||
| 56 | $_SERVER['PHP_SELF'] = $newUrl; |
||
| 57 | switch ($seoOp) { |
||
| 58 | case 'c': |
||
| 59 | $_SERVER['REQUEST_URI'] = $newUrl . '?cid=' . $seoArg; |
||
| 60 | $_GET['cid'] = $seoArg; |
||
| 61 | break; |
||
| 62 | case 'p': |
||
| 63 | $_SERVER['REQUEST_URI'] = $newUrl . '?lid=' . $seoArg; |
||
| 64 | $_GET['lid'] = $seoArg; |
||
| 65 | break; |
||
| 66 | |||
| 67 | } |
||
| 68 | |||
| 69 | include $seoMap[$seoOp]; |
||
| 70 | } |
||
| 71 | |||
| 72 | exit; |
||
| 73 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths